diff --git a/.gitignore b/.gitignore index f652a2c74c37d6..dad5a3efd8bcae 100644 --- a/.gitignore +++ b/.gitignore @@ -133,3 +133,5 @@ deps/uv/docs/src/guide/ deps/v8/gypfiles/Debug/ deps/v8/gypfiles/Release/ deps/v8/third_party/eu-strip/ + +.DS_Store diff --git a/.travis.yml b/.travis.yml index fad2e7f0c77509..21ec6dab70f994 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,4 @@ language: cpp -compiler: - - clang sudo: false cache: ccache os: linux @@ -13,14 +11,17 @@ matrix: script: - make lint # Lint the first commit in the PR. - - git log $TRAVIS_COMMIT_RANGE --pretty=format:'%h' --no-merges | tail -1 | xargs npx core-validate-commit --no-validate-metadata + - \[ -z "$TRAVIS_COMMIT_RANGE" \] || (echo -e '\nLinting the commit message according to the guidelines at https://goo.gl/p2fr5Q\n' && git log $TRAVIS_COMMIT_RANGE --pretty=format:'%h' --no-merges | tail -1 | xargs npx -q core-validate-commit --no-validate-metadata) - name: "Test Suite" + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-4.9 install: + - export CC='ccache gcc-4.9' CXX='ccache g++-4.9' JOBS=2 - ./configure - make -j2 V= script: - - make -j2 test - before_install: - - export CXX="ccache clang++ -Qunused-arguments" - - export CC="ccache clang -Qunused-arguments -Wno-unknown-warning-option" - - export JOBS=2 + - PARALLEL_ARGS='--flaky-tests=skip' make -j1 test diff --git a/BUILDING.md b/BUILDING.md index 839480eec38a88..efe39e656b383a 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -48,30 +48,28 @@ file a new issue. ## Supported platforms This list of supported platforms is current as of the branch/release to -which it is attached. +which it belongs. ### Input -Node.js relies on V8 and libuv. Therefore, we adopt a subset of their -supported platforms. +Node.js relies on V8 and libuv. We adopt a subset of their supported platforms. ### Strategy -Support is divided into three tiers: +There are three support tiers: * **Tier 1**: Full test coverage and maintenance by the Node.js core team and the broader community. -* **Tier 2**: Full test coverage but more limited maintenance, - often provided by the vendor of the platform. -* **Experimental**: May not compile reliably or test suite may not pass. - These are often working to be promoted to Tier 2 but are not quite ready. - There is at least one individual actively providing maintenance and the team - is striving to broaden quality and reliability of support. +* **Tier 2**: Full test coverage. Limited maintenance, often provided by the + vendor of the platform. +* **Experimental**: May not compile or test suite may not pass. + These are often approaching Tier 2 support but are not quite ready. + There is at least one individual providing maintenance. ### Supported platforms The community does not build or test against end-of-life distributions (EoL). -Thus, we do not recommend that you use Node on end-of-life or unsupported +Thus, we do not recommend that you use Node.js on end-of-life or unsupported platforms in production. | System | Support type | Version | Architectures | Notes | @@ -97,8 +95,8 @@ platforms in production. 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 - hosts. Support is experimental for 32 bit hosts. +2: 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 like `mintty` requires the usage of [winpty](https://github.com/rprichard/winpty) @@ -111,12 +109,12 @@ platforms in production. community will only address issues that reproduce on native GNU/Linux systems. Issues that only reproduce on WSL should be reported in the [WSL issue tracker](https://github.com/Microsoft/WSL/issues). Running the - Windows binary (`node.exe`) in WSL is not recommended, and will not work - without adjustment (such as stdio redirection). + Windows binary (`node.exe`) in WSL is not recommended. It will not work + without workarounds such as stdio redirection. ### Supported toolchains -Depending on host platform, the selection of toolchains may vary. +Depending on the host platform, the selection of toolchains may vary. #### Unix @@ -128,11 +126,11 @@ Depending on host platform, the selection of toolchains may vary. #### Windows -* Visual Studio 2017 with the Windows 10 SDK on a 64 bit host. +* Visual Studio 2017 with the Windows 10 SDK on a 64-bit host. #### OpenSSL asm support -OpenSSL-1.1.0 requires the following asssembler version for use of asm +OpenSSL-1.1.0 requires the following assembler version for use of asm support on x86_64 and ia32. * gas (GNU assembler) version 2.23 or higher @@ -144,10 +142,8 @@ Otherwise `configure` will fail with an error. This can be avoided by either providing a newer assembler as per the list above or by using the `--openssl-no-asm` flag. -*Note:* The forthcoming OpenSSL-1.1.1 will require higher - version. Please refer - https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_ia32cap.html for - details. +The forthcoming OpenSSL-1.1.1 will have different requirements. Please refer to + https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_ia32cap.html for details. ## Building Node.js on supported platforms @@ -216,7 +212,7 @@ $ make test-only At this point, you are ready to make code changes and re-run the tests. -If you are running tests prior to submitting a Pull Request, the recommended +If you are running tests before submitting a Pull Request, the recommended command is: ```console @@ -318,7 +314,7 @@ These core dumps are useful for debugging when provided with the corresponding original debug binary and system information. Reading the core dump requires `gdb` built on the same platform the core dump -was captured on (i.e. 64 bit `gdb` for `node` built on a 64 bit system, Linux +was captured on (i.e. 64-bit `gdb` for `node` built on a 64-bit system, Linux `gdb` for `node` built on Linux) otherwise you will get errors like `not in executable format: File format not recognized`. @@ -344,7 +340,7 @@ Prerequisites: and tools which can be included in the global `PATH`. * The [NetWide Assembler](http://www.nasm.us/), for OpenSSL assembler modules. If not installed in the default location, it needs to be manually added - to `PATH`. Build with `openssl-no-asm` option does not require this. + to `PATH`. A build with the `openssl-no-asm` option does not need this. * **Optional** (to build the MSI): the [WiX Toolset v3.11](http://wixtoolset.org/releases/) and the [Wix Toolset Visual Studio 2017 Extension](https://marketplace.visualstudio.com/items?itemName=RobMensching.WixToolsetVisualStudio2017Extension). @@ -369,12 +365,10 @@ To test if Node.js was built correctly: ### Android/Android-based devices (e.g. Firefox OS) -Although these instructions for building on Android are provided, please note -that Android is not an officially supported platform at this time. Patches to -improve the Android build are accepted. However, there is no testing on Android -in the current continuous integration environment. The participation of people -dedicated and determined to improve Android building, testing, and support is -encouraged. +Android is not a supported platform. Patches to improve the Android build are +welcome. There is no testing on Android in the current continuous integration +environment. The participation of people dedicated and determined to improve +Android building, testing, and support is encouraged. Be sure you have downloaded and extracted [Android NDK](https://developer.android.com/tools/sdk/ndk/index.html) before in @@ -439,7 +433,7 @@ $ ./configure --without-intl $ pkg-config --modversion icu-i18n && ./configure --with-intl=system-icu ``` -If you are cross compiling, your `pkg-config` must be able to supply a path +If you are cross-compiling, your `pkg-config` must be able to supply a path that works for both your host and target environments. #### Build with a specific ICU: @@ -449,6 +443,10 @@ You can find other ICU releases at Download the file named something like `icu4c-**##.#**-src.tgz` (or `.zip`). +To check the minimum recommended ICU, run `./configure --help` and see +the help for the `--with-icu-source` option. A warning will be printed +during configuration if the ICU version is too old. + ##### Unix/macOS From an already-unpacked ICU: @@ -483,7 +481,7 @@ This version of Node.js does not support FIPS. ## Building Node.js with external core modules It is possible to specify one or more JavaScript text files to be bundled in -the binary as builtin modules when building Node.js. +the binary as built-in modules when building Node.js. ### Unix/macOS @@ -503,3 +501,14 @@ To make `./myModule.js` available via `require('myModule')` and ```console > .\vcbuild link-module './myModule.js' link-module './myModule2.js' ``` + +## Note for downstream distributors of Node.js + +The Node.js ecosystem is reliant on ABI compatibility within a major +release. To maintain ABI compatibility it is required that production +builds of Node.js will be built against the same version of dependencies as the +project vendors. If Node.js is to be built against a different version of a +dependency please create a custom `NODE_MODULE_VERSION` to ensure ecosystem +compatibility. Please consult with the TSC by opening an issue at +https://github.com/nodejs/tsc/issues if you decide to create a custom +`NODE_MODULE_VERSION` so we can avoid duplication in the ecosystem. diff --git a/CHANGELOG.md b/CHANGELOG.md index ab99af5f92621a..016970772e6feb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,5 @@ # Node.js Changelog - - -To make the changelog easier to both use and manage, it has been split into -multiple files organized according to significant major and minor Node.js -release lines. - Select a Node.js version below to view the changelog history: * [Node.js 10](doc/changelogs/CHANGELOG_V10.md) — **Long Term Support** @@ -31,7 +25,8 @@ release. -10.13.0
+10.13.1
+10.13.0
10.12.0
10.11.0
10.10.0
@@ -117,10 +112,9 @@ release. ### Notes -* Release streams marked with `LTS` are currently covered by the - [Node.js Long Term Support plan](https://github.com/nodejs/Release). -* Release versions displayed in **bold** text represent the most - recent actively supported release. +* The [Node.js Long Term Support plan](https://github.com/nodejs/Release) covers + LTS releases. +* Release versions in **bold** text are the most recent supported releases. ---- ---- diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 5a935352a1f9f0..4c211405596cb4 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,8 +1,4 @@ # Code of Conduct -The Node.js Code of Conduct document has moved to -https://github.com/nodejs/admin/blob/master/CODE_OF_CONDUCT.md. Please update -links to this document accordingly. - -The Node.js Moderation policy can be found at -https://github.com/nodejs/admin/blob/master/Moderation-Policy.md +* [Node.js Code of Conduct](https://github.com/nodejs/admin/blob/master/CODE_OF_CONDUCT.md) +* [Node.js Moderation Policy](https://github.com/nodejs/admin/blob/master/Moderation-Policy.md) diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md index 7a435c6478bf45..7fa6fee197aabc 100644 --- a/COLLABORATOR_GUIDE.md +++ b/COLLABORATOR_GUIDE.md @@ -28,7 +28,7 @@ - [Using `git-node`](#using-git-node) - [Technical HOWTO](#technical-howto) - [Troubleshooting](#troubleshooting) - - [I Just Made a Mistake](#i-just-made-a-mistake) + - [I Made a Mistake](#i-made-a-mistake) - [Long Term Support](#long-term-support) - [What is LTS?](#what-is-lts) - [How does LTS work?](#how-does-lts-work) @@ -38,13 +38,10 @@ - [How is an LTS release cut?](#how-is-an-lts-release-cut) * [Who to CC in the issue tracker](#who-to-cc-in-the-issue-tracker) -This document contains information for Collaborators of the Node.js -project regarding managing the project's code, documentation, and issue tracker. - -Collaborators should be familiar with the guidelines for new -contributors in [CONTRIBUTING.md](./CONTRIBUTING.md) and also -understand the project governance model as outlined in -[GOVERNANCE.md](./GOVERNANCE.md). +This document explains how Collaborators manage the Node.js project. +Collaborators should understand the +[guidelines for new contributors](CONTRIBUTING.md) and the +[project governance model](GOVERNANCE.md). ## Issues and Pull Requests @@ -100,7 +97,8 @@ As soon as the PR is ready to land, please do so. Landing your own pull requests allows other Collaborators to focus on other pull requests. If your pull request is still awaiting the [minimum time to land](#waiting-for-approvals), add the `author ready` label so other Collaborators know it can land as soon as the time -ends. +ends. If instead you wish to land the PR yourself, indicate this intent by using +the "assign yourself" button, to self-assign the PR. ## Accepting Modifications @@ -139,30 +137,26 @@ the CI outcome. ### Consensus Seeking -If there is no disagreement amongst Collaborators, a pull request should be -landed given appropriate review, a green CI, and the minimum -[waiting time](#waiting-for-approvals) for a PR. If it is still awaiting the -[minimum time to land](#waiting-for-approvals), please add the `author ready` -label to it so it is obvious that the PR can land as soon as the time ends. - -Where there is discussion amongst Collaborators, consensus should be sought if -possible. The lack of consensus may indicate the need to elevate discussion to -the TSC for resolution. - -If any Collaborator objects to a change *without giving any additional -explanation or context*, and the objecting Collaborator fails to respond to -explicit requests for explanation or context within a reasonable period of -time, the objection may be dismissed. Note that this does not apply to -objections that are explained. - -Note that breaking changes (that is, pull requests that require an increase in -the major version number, known as `semver-major` changes) must be [elevated for -review by the TSC](#involving-the-tsc). This does not necessarily mean that the -PR must be put onto the TSC meeting agenda. If multiple TSC members approve -(`LGTM`) the PR and no Collaborators oppose the PR, it should be landed. Where -there is disagreement among TSC members or objections from one or more -Collaborators, `semver-major` pull requests may be put on the TSC meeting -agenda. +If there are no objecting Collaborators, a pull request may land if it has the +needed [approvals](#code-reviews), [CI](#testing-and-ci), and +[wait time](#waiting-for-approvals). If a pull request meets all requirements +except the [wait time](#waiting-for-approvals), please add the +[`author ready`](#author-ready-pull-requests) label. + +Where there is disagreement among Collaborators, consensus should be sought if +possible. If reaching consensus is not possible, a Collaborator may escalate the +issue to the TSC. + +Collaborators should not block a pull request without providing a reason. +Another Collaborator may ask an objecting Collaborator to explain their +objection. If the objector is unresponsive, another Collaborator may dismiss the +objection. + +[Breaking changes](#breaking-changes) must receive +[TSC review](#involving-the-tsc). If two TSC members approve the pull request +and no Collaborators object, then it may land. If there are objections, a +Collaborator may apply the `tsc-agenda` label. That will put the pull request on +the TSC meeting agenda. #### Helpful resources @@ -190,7 +184,9 @@ Collaborators that previously approved the pull request. If someone disagrees with the fast-tracking request, remove the label and leave a comment indicating why the pull request should not be fast-tracked. The pull request can be landed once two or more Collaborators approve both the pull request and the -fast-tracking request, and the necessary CI testing is done. +fast-tracking request, and the necessary CI testing is done. A request to +fast-track a PR made by a different Collaborator than the pull-request author +counts as a fast-track approval. ### Testing and CI @@ -498,19 +494,23 @@ This should be done where a pull request: Assign the `tsc-review` label or @-mention the `@nodejs/tsc` GitHub team if you want to elevate an issue to the [TSC][]. -Do not use the GitHub UI on the right hand side to assign to +Do not use the GitHub UI on the right-hand side to assign to `@nodejs/tsc` or request a review from `@nodejs/tsc`. The TSC should serve as the final arbiter where required. ## Landing Pull Requests +1. Avoid landing PRs that are assigned to someone else. Authors who wish to land + their own PRs will self-assign them, or delegate to someone else. If in + doubt, ask the assignee whether it is okay to land. 1. Never use GitHub's green ["Merge Pull Request"][] button. Reasons for not using the web interface button: - * The merge method will add an unnecessary merge commit. - * The squash & merge method can add metadata (the PR #) to the commit title. - * If more than one author has contributed to the PR, keep the most recent - author when squashing. + * The "Create a merge commit" method will add an unnecessary merge commit. + * The "Squash and merge" method will add metadata (the PR #) to the commit + title. If more than one author has contributed to the PR, squashing will + only keep the most recent author. + * The "Rebase and merge" method has no way of adding metadata to the commit. 1. Make sure the CI is done and the result is green. If the CI is not green, check for flaky tests and infrastructure failures. Please check if those were already reported in the appropriate repository ([node][flaky tests] and @@ -521,13 +521,12 @@ The TSC should serve as the final arbiter where required. present. 1. Review the commit message to ensure that it adheres to the guidelines outlined in the [contributing][] guide. -1. Add all necessary [metadata](#metadata) to commit messages before landing. - See the commit log for examples such as [this - one](https://github.com/nodejs/node/commit/b636ba8186) if unsure exactly how - to format your commit messages. +1. Add all necessary [metadata](#metadata) to commit messages before landing. If + you are unsure exactly how to format the commit messages, use the commit log + as a reference. See [this commit][commit-example] as an example. -Check PRs from new contributors to make sure the person's name and email address -are correct before merging. +For PRs from first-time contributors, be [welcoming](#welcoming-first-time-contributors). +Also, verify that their git settings are to their liking. All commits should be self-contained, meaning every commit should pass all tests. This makes it much easier when bisecting to find a breaking change. @@ -745,7 +744,7 @@ make -j4 test git push upstream master ``` -### I Just Made a Mistake +### I Made a Mistake * Ping a TSC member. * `#node-dev` on freenode @@ -905,6 +904,7 @@ If you cannot find who to cc for a file, `git shortlog -n -s ` may help. [`node-core-utils`]: https://github.com/nodejs/node-core-utils [backporting guide]: doc/guides/backporting-to-release-lines.md [contributing]: ./doc/guides/contributing/pull-requests.md#commit-message-guidelines +[commit-example]: https://github.com/nodejs/node/commit/b636ba8186 [flaky tests]: https://github.com/nodejs/node/issues?q=is%3Aopen+is%3Aissue+label%3A%22CI+%2F+flaky+test%22y [git-node]: https://github.com/nodejs/node-core-utils/blob/master/docs/git-node.md [git-node-metadata]: https://github.com/nodejs/node-core-utils/blob/master/docs/git-node.md#git-node-metadata diff --git a/CPP_STYLE_GUIDE.md b/CPP_STYLE_GUIDE.md index ae0135b5c0bdff..5099f34ea866c9 100644 --- a/CPP_STYLE_GUIDE.md +++ b/CPP_STYLE_GUIDE.md @@ -2,6 +2,7 @@ ## Table of Contents +* [Guides and References](#guides-and-references) * [Formatting](#formatting) * [Left-leaning (C++ style) asterisks for pointer declarations](#left-leaning-c-style-asterisks-for-pointer-declarations) * [C++ style comments](#c-style-comments) @@ -17,7 +18,9 @@ * [Memory Management](#memory-management) * [Memory allocation](#memory-allocation) * [Use `nullptr` instead of `NULL` or `0`](#use-nullptr-instead-of-null-or-0) + * [Use explicit pointer comparisons](#use-explicit-pointer-comparisons) * [Ownership and Smart Pointers](#ownership-and-smart-pointers) + * [Avoid non-const references](#avoid-non-const-references) * [Others](#others) * [Type casting](#type-casting) * [Using `auto`](#using-auto) @@ -25,14 +28,30 @@ * [Avoid throwing JavaScript errors in C++ methods](#avoid-throwing-javascript-errors-in-c) * [Avoid throwing JavaScript errors in nested C++ methods](#avoid-throwing-javascript-errors-in-nested-c-methods) -Unfortunately, the C++ linter (based on -[Google’s `cpplint`](https://github.com/google/styleguide)), which can be run -explicitly via `make lint-cpp`, does not currently catch a lot of rules that are -specific to the Node.js C++ code base. This document explains the most common of -these rules: + +## Guides and References + +The Node.js C++ codebase strives to be consistent in its use of language +features and idioms, as well as have some specific guidelines for the use of +runtime features. + +Coding guidelines are based on the following guides (highest priority first): +1. This document +2. The [Google C++ Style Guide][] +3. The ISO [C++ Core Guidelines][] + +In general code should follow the C++ Core Guidelines, unless overridden by the +Google C++ Style Guide or this document. At the moment these guidelines are +checked manually by reviewers, with the goal to validate this with automatic +tools. ## Formatting +Unfortunately, the C++ linter (based on [Google’s `cpplint`][]), which can be +run explicitly via `make lint-cpp`, does not currently catch a lot of rules that +are specific to the Node.js C++ code base. This document explains the most +common of these rules: + ### Left-leaning (C++ style) asterisks for pointer declarations `char* buffer;` instead of `char *buffer;` @@ -175,40 +194,82 @@ class FancyContainer { ### Use `nullptr` instead of `NULL` or `0` -What it says in the title. +Further reading in the [C++ Core Guidelines][ES.47]. + +### Use explicit pointer comparisons + +Use explicit comparisons to `nullptr` when testing pointers, i.e. +`if (foo == nullptr)` instead of `if (foo)` and +`foo != nullptr` instead of `!foo`. ### Ownership and Smart Pointers -"Smart" pointers are classes that act like pointers, e.g. -by overloading the `*` and `->` operators. Some smart pointer types can be -used to automate ownership bookkeeping, to ensure these responsibilities are -met. `std::unique_ptr` is a smart pointer type introduced in C++11, which -expresses exclusive ownership of a dynamically allocated object; the object -is deleted when the `std::unique_ptr` goes out of scope. It cannot be -copied, but can be moved to represent ownership transfer. -`std::shared_ptr` is a smart pointer type that expresses shared ownership of a -dynamically allocated object. `std::shared_ptr`s can be copied; ownership -of the object is shared among all copies, and the object -is deleted when the last `std::shared_ptr` is destroyed. - -Prefer to use `std::unique_ptr` to make ownership -transfer explicit. For example: +* [R.20]: Use `std::unique_ptr` or `std::shared_ptr` to represent ownership +* [R.21]: Prefer `unique_ptr` over `shared_ptr` unless you need to share + ownership + +Use `std::unique_ptr` to make ownership transfer explicit. For example: ```cpp std::unique_ptr FooFactory(); void FooConsumer(std::unique_ptr ptr); ``` -Never use `std::auto_ptr`. Instead, use `std::unique_ptr`. +Since `std::unique_ptr` has only move semantics, passing one by value transfers +ownership to the callee and invalidates the caller's instance. + +Don't use `std::auto_ptr`, it is deprecated ([Reference][cppref_auto_ptr]). + +### Avoid non-const references + +Using non-const references often obscures which values are changed by an +assignment. Consider using a pointer instead, which requires more explicit +syntax to indicate that modifications take place. + +```c++ +class ExampleClass { + public: + explicit ExampleClass(OtherClass* other_ptr) : pointer_to_other_(other_ptr) {} + + void SomeMethod(const std::string& input_param, + std::string* in_out_param); // Pointer instead of reference + + const std::string& get_foo() const { return foo_string_; } + void set_foo(const std::string& new_value) { foo_string_ = new_value; } + + void ReplaceCharacterInFoo(char from, char to) { + // A non-const reference is okay here, because the method name already tells + // users that this modifies 'foo_string_' -- if that is not the case, + // it can still be better to use an indexed for loop, or leave appropriate + // comments. + for (char& character : foo_string_) { + if (character == from) + character = to; + } + } + + private: + std::string foo_string_; + // Pointer instead of reference. If this object 'owns' the other object, + // this should be a `std::unique_ptr`; a + // `std::shared_ptr` can also be a better choice. + OtherClass* pointer_to_other_; +}; +``` ## Others ### Type casting -- Always avoid C-style casts (`(type)value`) -- `dynamic_cast` does not work because RTTI is not enabled -- Use `static_cast` for casting whenever it works -- `reinterpret_cast` is okay if `static_cast` is not appropriate +- Use `static_cast` if casting is required, and it is valid +- Use `reinterpret_cast` only when it is necessary +- Avoid C-style casts (`(type)value`) +- `dynamic_cast` does not work because Node.js is built without + [Run Time Type Information][] + +Further reading: +* [ES.48]: Avoid casts +* [ES.49]: If you must use a cast, use a named cast ### Using `auto` @@ -299,9 +360,25 @@ exports.foo = function(str) { #### Avoid throwing JavaScript errors in nested C++ methods -When you have to throw the errors from C++, try to do it at the top level and -not inside of nested calls. +When you need to throw a JavaScript exception from C++ (i.e. +`isolate()->ThrowException()`) prefer to do it as close to the return to JS as +possible, and not inside of nested C++ calls. Since this changes the JS +execution state doing it closest to where it is consumed reduces the chances of +side effects. + +Node.js is built [without C++ exception handling][], so code using `throw` or +even `try` and `catch` **will** break. -Using C++ `throw` is not allowed. +[C++ Core Guidelines]: http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines +[Google C++ Style Guide]: https://google.github.io/styleguide/cppguide.html +[Google’s `cpplint`]: https://github.com/google/styleguide [errors]: https://github.com/nodejs/node/blob/master/doc/guides/using-internal-errors.md +[ES.47]: http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-nullptr +[ES.48]: http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-casts +[ES.49]: http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-casts-named +[R.20]: http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rr-owner +[R.21]: http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rr-unique +[Run Time Type Information]: https://en.wikipedia.org/wiki/Run-time_type_information +[cppref_auto_ptr]: https://en.cppreference.com/w/cpp/memory/auto_ptr +[without C++ exception handling]: https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_exceptions.html#intro.using.exception.no diff --git a/GOVERNANCE.md b/GOVERNANCE.md index 40ef6e7bbe5fcb..da6706e87f0d8c 100644 --- a/GOVERNANCE.md +++ b/GOVERNANCE.md @@ -45,7 +45,7 @@ be accepted unless: * Discussions and/or additional changes result in no Collaborators objecting to the change. Previously-objecting Collaborators do not necessarily have to - sign-off on the change, but they should not be opposed to it. + sign off on the change, but they should not be opposed to it. * The change is escalated to the TSC and the TSC votes to approve the change. This should only happen if disagreements between Collaborators cannot be resolved through discussion. @@ -123,7 +123,7 @@ The meeting chair is responsible for ensuring that minutes are taken and that a pull request with the minutes is submitted after the meeting. Due to the challenges of scheduling a global meeting with participants in -several timezones, the TSC will seek to resolve as many agenda items as possible +several time zones, the TSC will seek to resolve as many agenda items as possible outside of meetings using [the TSC issue tracker](https://github.com/nodejs/TSC/issues). The process in the issue tracker is: @@ -196,7 +196,7 @@ completed within a month after the nomination is accepted. ## Consensus Seeking Process -The TSC follows a [Consensus Seeking][] decision making model as described by +The TSC follows a [Consensus Seeking][] decision-making model as described by the [TSC Charter][]. [collaborators-discussions]: https://github.com/orgs/nodejs/teams/collaborators/discussions diff --git a/Makefile b/Makefile index a98772faea6dca..aa8d75242c00f5 100644 --- a/Makefile +++ b/Makefile @@ -203,7 +203,7 @@ coverage: coverage-test ## Run the tests and generate a coverage report. coverage-build: all mkdir -p node_modules if [ ! -d node_modules/nyc ]; then \ - $(NODE) ./deps/npm install nyc --no-save --no-package-lock; fi + $(NODE) ./deps/npm install nyc@13 --no-save --no-package-lock; fi if [ ! -d gcovr ]; then git clone -b 3.4 --depth=1 \ --single-branch git://github.com/gcovr/gcovr.git; fi if [ ! -d build ]; then git clone --depth=1 \ @@ -234,8 +234,9 @@ coverage-test: coverage-build $(NODE) ./node_modules/.bin/nyc merge 'out/Release/.coverage' \ .cov_tmp/libcov.json (cd lib && .$(NODE) ../node_modules/.bin/nyc report \ - --temp-directory "$(CURDIR)/.cov_tmp" \ - --report-dir "$(CURDIR)/coverage") + --temp-dir "$(CURDIR)/.cov_tmp" \ + --report-dir "$(CURDIR)/coverage" \ + --reporter html) -(cd out && "../gcovr/scripts/gcovr" --gcov-exclude='.*deps' \ --gcov-exclude='.*usr' -v -r Release/obj.target \ --html --html-detail -o ../coverage/cxxcoverage.html \ @@ -269,7 +270,7 @@ v8: tools/make-v8.sh $(V8_ARCH).$(BUILDTYPE_LOWER) $(V8_BUILD_OPTIONS) .PHONY: jstest -jstest: build-addons build-addons-napi ## Runs addon tests and JS tests +jstest: build-addons build-addons-napi bench-addons-build ## Runs addon tests and JS tests $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) \ --skip-tests=$(CI_SKIP_TESTS) \ $(CI_JS_SUITES) \ @@ -307,19 +308,19 @@ test-valgrind: all test-check-deopts: all $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) --check-deopts parallel sequential -benchmark/napi/function_call/build/Release/binding.node: all \ +benchmark/napi/function_call/build/Release/binding.node: \ benchmark/napi/function_call/napi_binding.c \ benchmark/napi/function_call/binding.cc \ - benchmark/napi/function_call/binding.gyp + benchmark/napi/function_call/binding.gyp | all $(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \ --python="$(PYTHON)" \ --directory="$(shell pwd)/benchmark/napi/function_call" \ --nodedir="$(shell pwd)" -benchmark/napi/function_args/build/Release/binding.node: all \ +benchmark/napi/function_args/build/Release/binding.node: \ benchmark/napi/function_args/napi_binding.c \ benchmark/napi/function_args/binding.cc \ - benchmark/napi/function_args/binding.gyp + benchmark/napi/function_args/binding.gyp | all $(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \ --python="$(PYTHON)" \ --directory="$(shell pwd)/benchmark/napi/function_args" \ @@ -413,7 +414,7 @@ clear-stalled: echo $${PS_OUT} | xargs kill -9; \ fi -test-build: | all build-addons build-addons-napi +test-build: | all build-addons build-addons-napi bench-addons-build test-build-addons-napi: all build-addons-napi @@ -443,7 +444,7 @@ test-ci-native: | test/addons/.buildstamp test/addons-napi/.buildstamp test-ci-js: | clear-stalled $(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \ --mode=$(BUILDTYPE_LOWER) --flaky-tests=$(FLAKY_TESTS) \ - $(TEST_CI_ARGS) $(CI_JS_SUITES) + $(TEST_CI_ARGS) $(CI_JS_SUITES) --skip-tests=sequential/test-benchmark-napi @echo "Clean up any leftover processes, error if found." ps awwx | grep Release/node | grep -v grep | cat @PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \ @@ -454,7 +455,7 @@ test-ci-js: | clear-stalled .PHONY: test-ci # Related CI jobs: most CI tests, excluding node-test-commit-arm-fanned test-ci: LOGLEVEL := info -test-ci: | clear-stalled build-addons build-addons-napi doc-only +test-ci: | clear-stalled build-addons build-addons-napi doc-only bench-addons-build out/Release/cctest --gtest_output=tap:cctest.tap $(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \ --mode=$(BUILDTYPE_LOWER) --flaky-tests=$(FLAKY_TESTS) \ @@ -495,7 +496,7 @@ test-debug: test-build test-message: test-build $(PYTHON) tools/test.py $(PARALLEL_ARGS) message -test-simple: | cctest # Depends on 'all'. +test-simple: | cctest bench-addons-build # Depends on 'all'. $(PYTHON) tools/test.py $(PARALLEL_ARGS) parallel sequential test-pummel: all @@ -1207,6 +1208,28 @@ lint-addon-docs: test/addons/.docbuildstamp cpplint: lint-cpp @echo "Please use lint-cpp instead of cpplint" +.PHONY: lint-py-build +# python -m pip install flake8 +# Try with '--system' is to overcome systems that blindly set '--user' +lint-py-build: + @echo "Pip installing flake8 linter on $(shell $(PYTHON) --version)..." + $(PYTHON) -m pip install --upgrade -t tools/pip/site-packages flake8 || \ + $(PYTHON) -m pip install --upgrade --system -t tools/pip/site-packages flake8 + +ifneq ("","$(wildcard tools/pip/site-packages)") +.PHONY: lint-py +# Lints the Python code with flake8. +# Flag the build if there are Python syntax errors or undefined names +lint-py: + PYTHONPATH=tools/pip $(PYTHON) -m flake8 . \ + --count --show-source --statistics --select=E901,E999,F821,F822,F823 \ + --exclude=deps,lib,src,tools/*_macros.py,tools/gyp,tools/jinja2,tools/pip +else +lint-py: + @echo "Python linting with flake8 is not avalible" + @echo "Run 'make lint-py-build'" +endif + .PHONY: lint .PHONY: lint-ci ifneq ("","$(wildcard tools/node_modules/eslint/)") @@ -1220,7 +1243,7 @@ lint: ## Run JS, C++, MD and doc linters. CONFLICT_RE=^>>>>>>> [0-9A-Fa-f]+|^<<<<<<< [A-Za-z]+ # Related CI job: node-test-linter -lint-ci: lint-js-ci lint-cpp lint-md lint-addon-docs +lint-ci: lint-js-ci lint-cpp lint-py lint-md lint-addon-docs @if ! ( grep -IEqrs "$(CONFLICT_RE)" benchmark deps doc lib src test tools ) \ && ! ( find . -maxdepth 1 -type f | xargs grep -IEqs "$(CONFLICT_RE)" ); then \ exit 0 ; \ diff --git a/README.md b/README.md index 47e178845d1dbf..671e5321450c7e 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ The Node.js project uses an [open governance model](./GOVERNANCE.md). The * [Current Project Team Members](#current-project-team-members) * [TSC (Technical Steering Committee)](#tsc-technical-steering-committee) * [Collaborators](#collaborators) - * [Release Team](#release-team) + * [Release Keys](#release-keys) * [Contributing to Node.js](#contributing-to-nodejs) ## Support @@ -81,7 +81,7 @@ your expectations. changes. Use with caution. Current and LTS releases follow [Semantic Versioning](https://semver.org). A -member of the [Release Team](#release-team) signs each Current and LTS release. +member of the Release Team [signs](#release-keys) each Current and LTS release. For more information, see the [Release README](https://github.com/nodejs/Release). @@ -133,9 +133,9 @@ $ grep node-vx.y.z.tar.gz SHASUMS256.txt | sha256sum -c - For Current and LTS, the GPG detached signature of `SHASUMS256.txt` is in `SHASUMS256.txt.sig`. You can use it with `gpg` to verify the integrity of -`SHASUM256.txt`. You will first need to import all the GPG keys of individuals -authorized to create releases. They are at the bottom of this README under -[Release Team](#release-team). To import the keys: +`SHASUM256.txt`. You will first need to import +[the GPG keys of individuals authorized to create releases](#release-keys). To +import the keys: ```console $ gpg --keyserver pool.sks-keyservers.net --recv-keys DD8F2338BAE7501E3DD5AC78C273792F7D83545D @@ -159,46 +159,31 @@ source and a list of supported platforms. ## Security -Security flaws in Node.js should be reported by emailing security@nodejs.org. -Please do not disclose security bugs publicly until they have been handled by -the security team. +If you find a security vulnerability in Node.js, please report it to +security@nodejs.org. Please withhold public disclosure until after the security +team has addressed the vulnerability. -Your email will be acknowledged within 24 hours, and you will receive a more -detailed response to your email within 48 hours indicating the next steps in -handling your report. +The security team will acknowledge your email within 24 hours. You will receive +a more detailed response within 48 hours. -There are no hard and fast rules to determine if a bug is worth reporting as -a security issue. The general rule is an issue worth reporting should allow an -attacker to compromise the confidentiality, integrity, or availability of the -Node.js application or its system for which the attacker does not already have -the capability. - -To illustrate the point, here are some examples of past issues and what the -Security Response Team thinks of them. When in doubt, however, please do send -us a report nonetheless. +There are no hard and fast rules to determine if a bug is worth reporting as a +security issue. Here are some examples of past issues and what the Security +Response Team thinks of them. When in doubt, please do send us a report +nonetheless. ### Public disclosure preferred - [#14519](https://github.com/nodejs/node/issues/14519): _Internal domain - function can be used to cause segfaults_. Causing program termination using - either the public JavaScript APIs or the private bindings layer APIs requires - the ability to execute arbitrary JavaScript code, which is already the highest - level of privilege possible. - -- [#12141](https://github.com/nodejs/node/pull/12141): _buffer: zero fill - Buffer(num) by default_. The buffer constructor behavior was documented, - but found to be prone to [mis-use](https://snyk.io/blog/exploiting-buffer/). - It has since been changed, but despite much debate, was not considered misuse - prone enough to justify fixing in older release lines and breaking our - API stability contract. + function can be used to cause segfaults_. Requires the ability to execute + arbitrary JavaScript code. That is already the highest level of privilege + possible. ### Private disclosure preferred - [CVE-2016-7099](https://nodejs.org/en/blog/vulnerability/september-2016-security-releases/): - _Fix invalid wildcard certificate validation check_. This is a high severity - defect that would allow a malicious TLS server to serve an invalid wildcard - certificate for its hostname and be improperly validated by a Node.js client. + _Fix invalid wildcard certificate validation check_. This was a high-severity + defect. It caused Node.js TLS clients to accept invalid wildcard certificates. - [#5507](https://github.com/nodejs/node/pull/5507): _Fix a defect that makes the CacheBleed Attack possible_. Many, though not all, OpenSSL vulnerabilities @@ -206,17 +191,15 @@ us a report nonetheless. - [CVE-2016-2216](https://nodejs.org/en/blog/vulnerability/february-2016-security-releases/): _Fix defects in HTTP header parsing for requests and responses that can allow - response splitting_. While the impact of this vulnerability is application and - network dependent, it is remotely exploitable in the HTTP protocol. + response splitting_. This was a remotely-exploitable defect in the Node.js + HTTP implementation. When in doubt, please do send us a report. ## Current Project Team Members -The Node.js project team comprises a group of core collaborators and a sub-group -that forms the _Technical Steering Committee_ (TSC) which governs the project. -For more information about the governance of the Node.js project, see +For information about the governance of the Node.js project, see [GOVERNANCE.md](./GOVERNANCE.md). ### TSC (Technical Steering Committee) @@ -453,8 +436,6 @@ For more information about the governance of the Node.js project, see **Alexis Campailla** <orangemocha@nodejs.org> * [othiym23](https://github.com/othiym23) - **Forrest L Norvell** <ogd@aoaioxxysz.net> (he/him) -* [phillipj](https://github.com/phillipj) - -**Phillip Johnsen** <johphi@gmail.com> * [pmq20](https://github.com/pmq20) - **Minqi Pan** <pmq2001@gmail.com> * [princejwesley](https://github.com/princejwesley) - @@ -554,6 +535,8 @@ For more information about the governance of the Node.js project, see **Oleg Elifantiev** <oleg@elifantiev.ru> * [petkaantonov](https://github.com/petkaantonov) - **Petka Antonov** <petka_antonov@hotmail.com> +* [phillipj](https://github.com/phillipj) - +**Phillip Johnsen** <johphi@gmail.com> * [piscisaureus](https://github.com/piscisaureus) - **Bert Belder** <bertbelder@gmail.com> * [rlidwka](https://github.com/rlidwka) - @@ -572,9 +555,9 @@ For more information about the governance of the Node.js project, see Collaborators follow the [COLLABORATOR_GUIDE.md](./COLLABORATOR_GUIDE.md) in maintaining the Node.js project. -### Release Team +### Release Keys -Node.js releases are signed with one of the following GPG keys: +GPG keys used to sign Node.js releases: * **Colin Ihrig** <cjihrig@gmail.com> `94AE36675C464D64BAFA68DD7434390BDBE9B9C5` @@ -593,7 +576,7 @@ Node.js releases are signed with one of the following GPG keys: * **Rod Vagg** <rod@vagg.org> `DD8F2338BAE7501E3DD5AC78C273792F7D83545D` -The full set of trusted release keys can be imported by running: +To import the full set of trusted release keys: ```shell gpg --keyserver pool.sks-keyservers.net --recv-keys 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 @@ -609,7 +592,7 @@ gpg --keyserver pool.sks-keyservers.net --recv-keys DD8F2338BAE7501E3DD5AC78C273 See the section above on [Verifying Binaries](#verifying-binaries) for how to use these keys to verify a downloaded file. -Previous releases may also have been signed with one of the following GPG keys: +Other keys used to sign some previous releases: * **Chris Dickinson** <christopher.s.dickinson@gmail.com> `9554F04D7259F04124DE6B476D5A82AC7E37093B` diff --git a/benchmark/_http-benchmarkers.js b/benchmark/_http-benchmarkers.js index 76e02504b27ec1..9079dff3ff83cc 100644 --- a/benchmark/_http-benchmarkers.js +++ b/benchmark/_http-benchmarkers.js @@ -8,7 +8,7 @@ const requirementsURL = 'https://github.com/nodejs/node/blob/master/doc/guides/writing-and-running-benchmarks.md#http-benchmark-requirements'; // The port used by servers and wrk -exports.PORT = process.env.PORT || 12346; +exports.PORT = Number(process.env.PORT) || 12346; class AutocannonBenchmarker { constructor() { diff --git a/benchmark/fs/bench-mkdirp.js b/benchmark/fs/bench-mkdirp.js index 96a792c35a48e4..b9e62045f6cf50 100644 --- a/benchmark/fs/bench-mkdirp.js +++ b/benchmark/fs/bench-mkdirp.js @@ -16,7 +16,7 @@ function main({ n }) { if (cntr-- <= 0) return bench.end(n); const pathname = `${tmpdir.path}/${++dirc}/${++dirc}/${++dirc}/${++dirc}`; - fs.mkdir(pathname, { createParents: true }, (err) => { + fs.mkdir(pathname, { recursive: true }, (err) => { r(cntr); }); }(n)); diff --git a/benchmark/http/bench-parser.js b/benchmark/http/bench-parser.js index d629fe67e59e76..fdf4ec0d1eda14 100644 --- a/benchmark/http/bench-parser.js +++ b/benchmark/http/bench-parser.js @@ -31,7 +31,7 @@ function processHeader(header, n) { bench.start(); for (var i = 0; i < n; i++) { parser.execute(header, 0, header.length); - parser.reinitialize(REQUEST); + parser.reinitialize(REQUEST, i > 0); } bench.end(n); } diff --git a/benchmark/misc/freelist.js b/benchmark/misc/freelist.js index 8c3281cc407363..7fa9af4f3ddb7f 100644 --- a/benchmark/misc/freelist.js +++ b/benchmark/misc/freelist.js @@ -9,7 +9,7 @@ const bench = common.createBenchmark(main, { }); function main({ n }) { - const FreeList = require('internal/freelist'); + const { FreeList } = require('internal/freelist'); const poolSize = 1000; const list = new FreeList('test', poolSize, Object); var j; diff --git a/benchmark/napi/function_args/napi_binding.c b/benchmark/napi/function_args/napi_binding.c index b697644ca441e9..1a3a0f1cd2b96e 100644 --- a/benchmark/napi/function_args/napi_binding.c +++ b/benchmark/napi/function_args/napi_binding.c @@ -50,7 +50,8 @@ static napi_value CallWithArray(napi_env env, napi_callback_info info) { status = napi_get_array_length(env, array, &length); assert(status == napi_ok); - for (uint32_t i = 0; i < length; ++i) { + uint32_t i; + for (i = 0; i < length; ++i) { napi_value v; status = napi_get_element(env, array, i, &v); assert(status == napi_ok); @@ -173,7 +174,8 @@ static napi_value CallWithArguments(napi_env env, napi_callback_info info) { status = napi_get_value_uint32(env, args[0], &loop); assert(status == napi_ok); - for (uint32_t i = 1; i < loop; ++i) { + uint32_t i; + for (i = 1; i < loop; ++i) { assert(i < argc); status = napi_typeof(env, args[i], types); assert(status == napi_ok); diff --git a/common.gypi b/common.gypi index 14c6b5ae9f8463..a04c1df94b539f 100644 --- a/common.gypi +++ b/common.gypi @@ -28,12 +28,9 @@ 'openssl_fips%': '', - # Default to -O0 for debug builds. - 'v8_optimized_debug%': 0, - # 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.36', + 'v8_embedder_string': '-node.46', # Enable disassembler for `--print-code` v8 options 'v8_enable_disassembler': 1, diff --git a/configure.py b/configure.py index b98e37d944d7f0..bf9a10d6474805 100755 --- a/configure.py +++ b/configure.py @@ -1,3 +1,4 @@ +import json import sys import errno import optparse @@ -50,6 +51,8 @@ valid_mips_fpu = ('fp32', 'fp64', 'fpxx') valid_mips_float_abi = ('soft', 'hard') valid_intl_modes = ('none', 'small-icu', 'full-icu', 'system-icu') +with open ('tools/icu/icu_versions.json') as f: + icu_versions = json.load(f) # create option groups shared_optgroup = optparse.OptionGroup(parser, "Shared libraries", @@ -387,6 +390,12 @@ dest='with_etw', help='build with ETW (default is true on Windows)') +parser.add_option('--use-largepages', + action='store_true', + dest='node_use_large_pages', + help='build with Large Pages support. This feature is supported only on Linux kernel' + + '>= 2.6.38 with Transparent Huge pages enabled') + intl_optgroup.add_option('--with-intl', action='store', dest='with_intl', @@ -418,7 +427,9 @@ intl_optgroup.add_option('--with-icu-source', action='store', dest='with_icu_source', - help='Intl mode: optional local path to icu/ dir, or path/URL of icu source archive.') + help='Intl mode: optional local path to icu/ dir, or path/URL of ' + 'the icu4c source archive. ' + 'v%d.x or later recommended.' % icu_versions["minimum_icu"]) parser.add_option('--with-ltcg', action='store_true', @@ -565,6 +576,12 @@ default=True, help='get more output from this script') +parser.add_option('--v8-non-optimized-debug', + action='store_true', + dest='v8_non_optimized_debug', + default=False, + help='compile V8 with minimal optimizations and with runtime checks') + # Create compile_commands.json in out/Debug and out/Release. parser.add_option('-C', action='store_true', @@ -1007,6 +1024,24 @@ def configure_node(o): else: o['variables']['node_use_dtrace'] = 'false' + if options.node_use_large_pages and flavor != 'linux': + raise Exception( + 'Large pages are supported only on Linux Systems.') + if options.node_use_large_pages and flavor == 'linux': + if options.shared or options.enable_static: + raise Exception( + 'Large pages are supported only while creating node executable.') + if target_arch!="x64": + raise Exception( + 'Large pages are supported only x64 platform.') + # Example full version string: 2.6.32-696.28.1.el6.x86_64 + FULL_KERNEL_VERSION=os.uname()[2] + KERNEL_VERSION=FULL_KERNEL_VERSION.split('-')[0] + if KERNEL_VERSION < "2.6.38": + raise Exception( + 'Large pages need Linux kernel version >= 2.6.38') + o['variables']['node_use_large_pages'] = b(options.node_use_large_pages) + if options.no_ifaddrs: o['defines'] += ['SUNOS_NO_IFADDRS'] @@ -1127,7 +1162,7 @@ def configure_library(lib, output): def configure_v8(o): o['variables']['v8_enable_gdbjit'] = 1 if options.gdb else 0 o['variables']['v8_no_strict_aliasing'] = 1 # Work around compiler bugs. - o['variables']['v8_optimized_debug'] = 0 # Compile with -O0 in debug builds. + o['variables']['v8_optimized_debug'] = 0 if options.v8_non_optimized_debug else 1 o['variables']['v8_random_seed'] = 0 # Use a random seed for hash tables. o['variables']['v8_promise_internal_field_count'] = 1 # Add internal field to promises for async hooks. o['variables']['v8_use_snapshot'] = 'false' if options.without_snapshot else 'true' @@ -1252,13 +1287,9 @@ def glob_to_var(dir_base, dir_sub, patch_dir): return list def configure_intl(o): - icus = [ - { - 'url': 'https://sourceforge.net/projects/icu/files/ICU4C/62.1/icu4c-62_1-src.zip', - 'md5': '408854f7b9b58311b68fab4b4dfc80be', - }, - ] def icu_download(path): + with open('tools/icu/current_ver.dep') as f: + icus = json.load(f) # download ICU, if needed if not os.access(options.download_path, os.W_OK): error('''Cannot write to desired download path. @@ -1449,6 +1480,9 @@ def write_config(data, name): icu_ver_major = m.group(1) if not icu_ver_major: error('Could not read U_ICU_VERSION_SHORT version from %s' % uvernum_h) + elif int(icu_ver_major) < icu_versions["minimum_icu"]: + error('icu4c v%d.x is too old, v%d.x or later is required.' % (int(icu_ver_major), + icu_versions["minimum_icu"])) icu_endianness = sys.byteorder[0]; o['variables']['icu_ver_major'] = icu_ver_major o['variables']['icu_endianness'] = icu_endianness diff --git a/deps/cares/src/ares_android.h b/deps/cares/src/ares_android.h new file mode 100644 index 00000000000000..ff520f96e8eacc --- /dev/null +++ b/deps/cares/src/ares_android.h @@ -0,0 +1,26 @@ +/* Copyright (C) 2017 by John Schember + * + * Permission to use, copy, modify, and distribute this + * software and its documentation for any purpose and without + * fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting + * documentation, and that the name of M.I.T. not be used in + * advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" + * without express or implied warranty. + */ + +#ifndef __ARES_ANDROID_H__ +#define __ARES_ANDROID_H__ + +#if defined(ANDROID) || defined(__ANDROID__) + +char **ares_get_android_server_list(size_t max_servers, size_t *num_servers); +void ares_library_cleanup_android(void); + +#endif + +#endif /* __ARES_ANDROID_H__ */ diff --git a/deps/v8/gypfiles/d8.gyp b/deps/v8/gypfiles/d8.gyp index f593a2b044ee4a..9611dfccf8aff0 100644 --- a/deps/v8/gypfiles/d8.gyp +++ b/deps/v8/gypfiles/d8.gyp @@ -23,6 +23,7 @@ 'include_dirs+': [ '..', '<(DEPTH)', + '<(SHARED_INTERMEDIATE_DIR)', ], 'sources': [ '../src/d8.h', diff --git a/deps/v8/gypfiles/toolchain.gypi b/deps/v8/gypfiles/toolchain.gypi index ea8f1c2f00da56..4860c5b7724e20 100644 --- a/deps/v8/gypfiles/toolchain.gypi +++ b/deps/v8/gypfiles/toolchain.gypi @@ -1134,121 +1134,7 @@ }], ], # conditions 'configurations': { - # Abstract configuration for v8_optimized_debug == 0. - 'DebugBase0': { - 'abstract': 1, - 'msvs_settings': { - 'VCCLCompilerTool': { - 'Optimization': '0', - 'conditions': [ - ['component=="shared_library" or force_dynamic_crt==1', { - 'RuntimeLibrary': '3', # /MDd - }, { - 'RuntimeLibrary': '1', # /MTd - }], - ], - }, - 'VCLinkerTool': { - 'LinkIncremental': '2', - }, - }, - 'variables': { - 'v8_enable_slow_dchecks%': 1, - }, - 'conditions': [ - ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \ - OS=="qnx" or OS=="aix"', { - 'cflags!': [ - '-O3', - '-O2', - '-O1', - '-Os', - ], - 'cflags': [ - '-fdata-sections', - '-ffunction-sections', - ], - }], - ['OS=="mac"', { - 'xcode_settings': { - 'GCC_OPTIMIZATION_LEVEL': '0', # -O0 - }, - }], - ['v8_enable_slow_dchecks==1', { - 'defines': [ - 'ENABLE_SLOW_DCHECKS', - ], - }], - ], - }, # DebugBase0 - # Abstract configuration for v8_optimized_debug == 1. - 'DebugBase1': { - 'abstract': 1, - 'msvs_settings': { - 'VCCLCompilerTool': { - 'Optimization': '2', - 'InlineFunctionExpansion': '2', - 'EnableIntrinsicFunctions': 'true', - 'FavorSizeOrSpeed': '0', - 'StringPooling': 'true', - 'BasicRuntimeChecks': '0', - 'conditions': [ - ['component=="shared_library" or force_dynamic_crt==1', { - 'RuntimeLibrary': '3', #/MDd - }, { - 'RuntimeLibrary': '1', #/MTd - }], - ], - }, - 'VCLinkerTool': { - 'LinkIncremental': '1', - 'OptimizeReferences': '2', - 'EnableCOMDATFolding': '2', - }, - }, - 'variables': { - 'v8_enable_slow_dchecks%': 0, - }, - 'conditions': [ - ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \ - OS=="qnx" or OS=="aix"', { - 'cflags!': [ - '-O0', - '-O1', - '-Os', - ], - 'cflags': [ - '-fdata-sections', - '-ffunction-sections', - ], - 'conditions': [ - # Don't use -O3 with sanitizers. - ['asan==0 and msan==0 and lsan==0 \ - and tsan==0 and ubsan==0 and ubsan_vptr==0', { - 'cflags': ['-O3'], - 'cflags!': ['-O2'], - }, { - 'cflags': ['-O2'], - 'cflags!': ['-O3'], - }], - ], - }], - ['OS=="mac"', { - 'xcode_settings': { - 'GCC_OPTIMIZATION_LEVEL': '3', # -O3 - 'GCC_STRICT_ALIASING': 'YES', - }, - }], - ['v8_enable_slow_dchecks==1', { - 'defines': [ - 'ENABLE_SLOW_DCHECKS', - ], - }], - ], - }, # DebugBase1 - # Common settings for the Debug configuration. - 'DebugBaseCommon': { - 'abstract': 1, + 'Debug': { 'defines': [ 'ENABLE_DISASSEMBLER', 'V8_ENABLE_CHECKS', @@ -1311,27 +1197,126 @@ }], ], }], - ], - }, # DebugBaseCommon - 'Debug': { - 'inherit_from': ['DebugBaseCommon'], - 'conditions': [ ['v8_optimized_debug==0', { - 'inherit_from': ['DebugBase0'], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'Optimization': '0', + 'conditions': [ + ['component=="shared_library" or force_dynamic_crt==1', { + 'RuntimeLibrary': '3', # /MDd + }, { + 'RuntimeLibrary': '1', # /MTd + }], + ], + }, + 'VCLinkerTool': { + 'LinkIncremental': '2', + }, + }, + 'variables': { + 'v8_enable_slow_dchecks%': 1, + }, + 'conditions': [ + ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \ + OS=="qnx" or OS=="aix"', { + 'cflags!': [ + '-O3', + '-O2', + '-O1', + '-Os', + ], + 'cflags': [ + '-fdata-sections', + '-ffunction-sections', + ], + }], + ['OS=="mac"', { + 'xcode_settings': { + 'GCC_OPTIMIZATION_LEVEL': '0', # -O0 + }, + }], + ['v8_enable_slow_dchecks==1', { + 'defines': [ + 'ENABLE_SLOW_DCHECKS', + ], + }], + ], }, { - 'inherit_from': ['DebugBase1'], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'Optimization': '2', + 'InlineFunctionExpansion': '2', + 'EnableIntrinsicFunctions': 'true', + 'FavorSizeOrSpeed': '0', + 'StringPooling': 'true', + 'BasicRuntimeChecks': '0', + 'conditions': [ + ['component=="shared_library" or force_dynamic_crt==1', { + 'RuntimeLibrary': '3', #/MDd + }, { + 'RuntimeLibrary': '1', #/MTd + }], + ], + }, + 'VCLinkerTool': { + 'LinkIncremental': '1', + 'OptimizeReferences': '2', + 'EnableCOMDATFolding': '2', + }, + }, + 'variables': { + 'v8_enable_slow_dchecks%': 0, + }, + 'conditions': [ + ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \ + OS=="qnx" or OS=="aix"', { + 'cflags!': [ + '-O0', + '-O1', + '-Os', + ], + 'cflags': [ + '-fdata-sections', + '-ffunction-sections', + ], + 'conditions': [ + # Don't use -O3 with sanitizers. + ['asan==0 and msan==0 and lsan==0 \ + and tsan==0 and ubsan==0 and ubsan_vptr==0', { + 'cflags': ['-O3'], + 'cflags!': ['-O2'], + }, { + 'cflags': ['-O2'], + 'cflags!': ['-O3'], + }], + ], + }], + ['OS=="mac"', { + 'xcode_settings': { + 'GCC_OPTIMIZATION_LEVEL': '3', # -O3 + 'GCC_STRICT_ALIASING': 'YES', + }, + }], + ['v8_enable_slow_dchecks==1', { + 'defines': [ + 'ENABLE_SLOW_DCHECKS', + ], + }], + ], }], # Temporary refs: https://github.com/nodejs/node/pull/23801 ['v8_enable_handle_zapping==1', { 'defines': ['ENABLE_HANDLE_ZAPPING',], }], ], - }, # Debug - 'ReleaseBase': { - 'abstract': 1, + + }, # DebugBaseCommon + 'Release': { 'variables': { 'v8_enable_slow_dchecks%': 0, }, + # Temporary refs: https://github.com/nodejs/node/pull/23801 + 'defines!': ['ENABLE_HANDLE_ZAPPING',], 'conditions': [ ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" \ or OS=="aix"', { @@ -1407,29 +1392,6 @@ }], ], # conditions }, # Release - 'Release': { - 'inherit_from': ['ReleaseBase'], - # Temporary refs: https://github.com/nodejs/node/pull/23801 - 'defines!': ['ENABLE_HANDLE_ZAPPING',], - }, # Debug - 'conditions': [ - [ 'OS=="win"', { - # TODO(bradnelson): add a gyp mechanism to make this more graceful. - 'Debug_x64': { - 'inherit_from': ['DebugBaseCommon'], - 'conditions': [ - ['v8_optimized_debug==0', { - 'inherit_from': ['DebugBase0'], - }, { - 'inherit_from': ['DebugBase1'], - }], - ], - }, - 'Release_x64': { - 'inherit_from': ['ReleaseBase'], - }, - }], - ], }, # configurations 'msvs_disabled_warnings': [ 4245, # Conversion with signed/unsigned mismatch. diff --git a/deps/v8/gypfiles/v8.gyp b/deps/v8/gypfiles/v8.gyp index 8c78f022551e66..e18429b6d2ffdf 100644 --- a/deps/v8/gypfiles/v8.gyp +++ b/deps/v8/gypfiles/v8.gyp @@ -2461,23 +2461,10 @@ '../third_party/antlr4/runtime/Cpp/runtime/src', '../src/torque', ], - # This is defined trough `configurations` for GYP+ninja compatibility - 'configurations': { - 'Debug': { - 'msvs_settings': { - 'VCCLCompilerTool': { - 'RuntimeTypeInfo': 'true', - 'ExceptionHandling': 1, - }, - } - }, - 'Release': { - 'msvs_settings': { - 'VCCLCompilerTool': { - 'RuntimeTypeInfo': 'true', - 'ExceptionHandling': 1, - }, - } + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeTypeInfo': 'true', + 'ExceptionHandling': 1, }, }, 'sources': [ diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index 55ad7c8cf220cc..a5aaf2d6842dde 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -1019,9 +1019,9 @@ class V8_EXPORT PrimitiveArray { public: static Local New(Isolate* isolate, int length); int Length() const; - V8_DEPRECATED("Use Isolate* version", + V8_DEPRECATE_SOON("Use Isolate* version", void Set(int index, Local item)); - V8_DEPRECATED("Use Isolate* version", + V8_DEPRECATE_SOON("Use Isolate* version", Local Get(int index)); void Set(Isolate* isolate, int index, Local item); Local Get(Isolate* isolate, int index); @@ -1739,8 +1739,8 @@ class V8_EXPORT StackTrace { /** * Returns a StackFrame at a particular index. */ - V8_DEPRECATED("Use Isolate version", - Local GetFrame(uint32_t index) const); + V8_DEPRECATE_SOON("Use Isolate version", + Local GetFrame(uint32_t index) const); Local GetFrame(Isolate* isolate, uint32_t index) const; /** @@ -2451,7 +2451,7 @@ class V8_EXPORT Value : public Data { inline V8_DEPRECATED("Use maybe version", Local ToBoolean() const); - inline V8_DEPRECATED("Use maybe version", Local ToString() const); + inline V8_DEPRECATE_SOON("Use maybe version", Local ToString() const); inline V8_DEPRECATED("Use maybe version", Local ToObject() const); inline V8_DEPRECATED("Use maybe version", Local ToInteger() const); @@ -2471,7 +2471,7 @@ class V8_EXPORT Value : public Data { Local context) const; V8_WARN_UNUSED_RESULT Maybe Int32Value(Local context) const; - V8_DEPRECATED("Use maybe version", bool BooleanValue() const); + V8_DEPRECATE_SOON("Use maybe version", bool BooleanValue() const); V8_DEPRECATED("Use maybe version", double NumberValue() const); V8_DEPRECATED("Use maybe version", int64_t IntegerValue() const); V8_DEPRECATED("Use maybe version", uint32_t Uint32Value() const); @@ -2584,7 +2584,7 @@ class V8_EXPORT String : public Name { * Returns the number of bytes in the UTF-8 encoded * representation of this string. */ - V8_DEPRECATED("Use Isolate version instead", int Utf8Length() const); + V8_DEPRECATE_SOON("Use Isolate version instead", int Utf8Length() const); int Utf8Length(Isolate* isolate) const; @@ -2642,23 +2642,23 @@ class V8_EXPORT String : public Name { // 16-bit character codes. int Write(Isolate* isolate, uint16_t* buffer, int start = 0, int length = -1, int options = NO_OPTIONS) const; - V8_DEPRECATED("Use Isolate* version", - int Write(uint16_t* buffer, int start = 0, int length = -1, - int options = NO_OPTIONS) const); + V8_DEPRECATE_SOON("Use Isolate* version", + int Write(uint16_t* buffer, int start = 0, int length = -1, + int options = NO_OPTIONS) const); // One byte characters. int WriteOneByte(Isolate* isolate, uint8_t* buffer, int start = 0, int length = -1, int options = NO_OPTIONS) const; - V8_DEPRECATED("Use Isolate* version", - int WriteOneByte(uint8_t* buffer, int start = 0, - int length = -1, int options = NO_OPTIONS) + V8_DEPRECATE_SOON("Use Isolate* version", + int WriteOneByte(uint8_t* buffer, int start = 0, + int length = -1, int options = NO_OPTIONS) const); // UTF-8 encoded characters. int WriteUtf8(Isolate* isolate, char* buffer, int length = -1, int* nchars_ref = NULL, int options = NO_OPTIONS) const; - V8_DEPRECATED("Use Isolate* version", - int WriteUtf8(char* buffer, int length = -1, - int* nchars_ref = NULL, - int options = NO_OPTIONS) const); + V8_DEPRECATE_SOON("Use Isolate* version", + int WriteUtf8(char* buffer, int length = -1, + int* nchars_ref = NULL, + int options = NO_OPTIONS) const); /** * A zero length string. @@ -2822,9 +2822,9 @@ class V8_EXPORT String : public Name { */ static Local Concat(Isolate* isolate, Local left, Local right); - static V8_DEPRECATED("Use Isolate* version", - Local Concat(Local left, - Local right)); + static V8_DEPRECATE_SOON("Use Isolate* version", + Local Concat(Local left, + Local right)); /** * Creates a new external string using the data defined in the given @@ -5049,8 +5049,8 @@ class V8_EXPORT BooleanObject : public Object { class V8_EXPORT StringObject : public Object { public: static Local New(Isolate* isolate, Local value); - V8_DEPRECATED("Use Isolate* version", - static Local New(Local value)); + V8_DEPRECATE_SOON("Use Isolate* version", + static Local New(Local value)); Local ValueOf() const; diff --git a/deps/v8/infra/mb/mb_config.pyl b/deps/v8/infra/mb/mb_config.pyl index 23b00624557606..f863cedee87e5a 100644 --- a/deps/v8/infra/mb/mb_config.pyl +++ b/deps/v8/infra/mb/mb_config.pyl @@ -30,15 +30,27 @@ 'ppc.debug': 'default_debug_ppc', 'ppc.optdebug': 'default_optdebug_ppc', 'ppc.release': 'default_release_ppc', + 'ppc.debug.sim': 'default_debug_ppc_sim', + 'ppc.optdebug.sim': 'default_optdebug_ppc_sim', + 'ppc.release.sim': 'default_release_ppc_sim', 'ppc64.debug': 'default_debug_ppc64', 'ppc64.optdebug': 'default_optdebug_ppc64', 'ppc64.release': 'default_release_ppc64', + 'ppc64.debug.sim': 'default_debug_ppc64_sim', + 'ppc64.optdebug.sim': 'default_optdebug_ppc64_sim', + 'ppc64.release.sim': 'default_release_ppc64_sim', 's390.debug': 'default_debug_s390', 's390.optdebug': 'default_optdebug_s390', 's390.release': 'default_release_s390', + 's390.debug.sim': 'default_debug_s390_sim', + 's390.optdebug.sim': 'default_optdebug_s390_sim', + 's390.release.sim': 'default_release_s390_sim', 's390x.debug': 'default_debug_s390x', 's390x.optdebug': 'default_optdebug_s390x', 's390x.release': 'default_release_s390x', + 's390x.debug.sim': 'default_debug_s390x_sim', + 's390x.optdebug.sim': 'default_optdebug_s390x_sim', + 's390x.release.sim': 'default_release_s390x_sim', 'x64.debug': 'default_debug_x64', 'x64.optdebug': 'default_optdebug_x64', 'x64.release': 'default_release_x64', @@ -285,28 +297,52 @@ 'default_release_mips64el': [ 'release', 'simulate_mips64el'], 'default_debug_ppc': [ - 'debug', 'simulate_ppc', 'v8_enable_slow_dchecks', 'v8_full_debug'], + 'debug', 'ppc', 'v8_enable_slow_dchecks', 'v8_full_debug'], 'default_optdebug_ppc': [ - 'debug', 'simulate_ppc', 'v8_enable_slow_dchecks'], + 'debug', 'ppc', 'v8_enable_slow_dchecks'], 'default_release_ppc': [ + 'release', 'ppc'], + 'default_debug_ppc_sim': [ + 'debug', 'simulate_ppc', 'v8_enable_slow_dchecks', 'v8_full_debug'], + 'default_optdebug_ppc_sim': [ + 'debug', 'simulate_ppc', 'v8_enable_slow_dchecks'], + 'default_release_ppc_sim': [ 'release', 'simulate_ppc'], 'default_debug_ppc64': [ - 'debug', 'simulate_ppc64', 'v8_enable_slow_dchecks', 'v8_full_debug'], + 'debug', 'ppc64', 'gcc', 'v8_enable_slow_dchecks', 'v8_full_debug'], 'default_optdebug_ppc64': [ - 'debug', 'simulate_ppc64', 'v8_enable_slow_dchecks'], + 'debug', 'ppc64', 'gcc', 'v8_enable_slow_dchecks'], 'default_release_ppc64': [ + 'release', 'ppc64', 'gcc'], + 'default_debug_ppc64_sim': [ + 'debug', 'simulate_ppc64', 'v8_enable_slow_dchecks', 'v8_full_debug'], + 'default_optdebug_ppc64_sim': [ + 'debug', 'simulate_ppc64', 'v8_enable_slow_dchecks'], + 'default_release_ppc64_sim': [ 'release', 'simulate_ppc64'], 'default_debug_s390': [ - 'debug', 'simulate_s390', 'v8_enable_slow_dchecks', 'v8_full_debug'], + 'debug', 's390', 'v8_enable_slow_dchecks', 'v8_full_debug'], 'default_optdebug_s390': [ - 'debug', 'simulate_s390', 'v8_enable_slow_dchecks'], + 'debug', 's390', 'v8_enable_slow_dchecks'], 'default_release_s390': [ + 'release', 's390'], + 'default_debug_s390_sim': [ + 'debug', 'simulate_s390', 'v8_enable_slow_dchecks', 'v8_full_debug'], + 'default_optdebug_s390_sim': [ + 'debug', 'simulate_s390', 'v8_enable_slow_dchecks'], + 'default_release_s390_sim': [ 'release', 'simulate_s390'], 'default_debug_s390x': [ - 'debug', 'simulate_s390x', 'v8_enable_slow_dchecks', 'v8_full_debug'], + 'debug', 's390x', 'v8_enable_slow_dchecks', 'v8_full_debug'], 'default_optdebug_s390x': [ - 'debug', 'simulate_s390x', 'v8_enable_slow_dchecks'], + 'debug', 's390x', 'v8_enable_slow_dchecks'], 'default_release_s390x': [ + 'release', 's390x'], + 'default_debug_s390x_sim': [ + 'debug', 'simulate_s390x', 'v8_enable_slow_dchecks', 'v8_full_debug'], + 'default_optdebug_s390x_sim': [ + 'debug', 'simulate_s390x', 'v8_enable_slow_dchecks'], + 'default_release_s390x_sim': [ 'release', 'simulate_s390x'], 'default_debug_x64': [ 'debug', 'x64', 'v8_enable_slow_dchecks', 'v8_full_debug'], @@ -816,6 +852,22 @@ 'gn_args': 'v8_enable_verify_csa=true', }, + 's390': { + 'gn_args': 'target_cpu="s390x" v8_target_cpu="s390"', + }, + + 's390x': { + 'gn_args': 'target_cpu="s390x" v8_target_cpu="s390x"', + }, + + 'ppc': { + 'gn_args': 'target_cpu="ppc"', + }, + + 'ppc64': { + 'gn_args': 'target_cpu="ppc64" use_custom_libcxx=false', + }, + 'x64': { 'gn_args': 'target_cpu="x64"', }, @@ -823,5 +875,6 @@ 'x86': { 'gn_args': 'target_cpu="x86"', }, + }, } diff --git a/deps/v8/src/compiler/bytecode-graph-builder.cc b/deps/v8/src/compiler/bytecode-graph-builder.cc index ade917de476ef7..8a60d680332e61 100644 --- a/deps/v8/src/compiler/bytecode-graph-builder.cc +++ b/deps/v8/src/compiler/bytecode-graph-builder.cc @@ -514,7 +514,7 @@ Node* BytecodeGraphBuilder::Environment::Checkpoint( BytecodeGraphBuilder::BytecodeGraphBuilder( Zone* local_zone, Handle shared_info, Handle feedback_vector, BailoutId osr_offset, - JSGraph* jsgraph, CallFrequency invocation_frequency, + JSGraph* jsgraph, CallFrequency& invocation_frequency, SourcePositionTable* source_positions, Handle native_context, int inlining_id, JSTypeHintLowering::Flags flags, bool stack_check, bool analyze_environment_liveness) diff --git a/deps/v8/src/compiler/bytecode-graph-builder.h b/deps/v8/src/compiler/bytecode-graph-builder.h index 9025d477d57fe3..15eef5d844e140 100644 --- a/deps/v8/src/compiler/bytecode-graph-builder.h +++ b/deps/v8/src/compiler/bytecode-graph-builder.h @@ -31,7 +31,7 @@ class BytecodeGraphBuilder { BytecodeGraphBuilder( Zone* local_zone, Handle shared, Handle feedback_vector, BailoutId osr_offset, - JSGraph* jsgraph, CallFrequency invocation_frequency, + JSGraph* jsgraph, CallFrequency& invocation_frequency, SourcePositionTable* source_positions, Handle native_context, int inlining_id = SourcePosition::kNotInlined, JSTypeHintLowering::Flags flags = JSTypeHintLowering::kNoFlags, diff --git a/deps/v8/src/compiler/js-inlining.cc b/deps/v8/src/compiler/js-inlining.cc index 08917ab78bd93d..075155c2496ba7 100644 --- a/deps/v8/src/compiler/js-inlining.cc +++ b/deps/v8/src/compiler/js-inlining.cc @@ -484,9 +484,10 @@ Reduction JSInliner::ReduceJSCall(Node* node) { if (info_->is_bailout_on_uninitialized()) { flags |= JSTypeHintLowering::kBailoutOnUninitialized; } + CallFrequency frequency = call.frequency(); BytecodeGraphBuilder graph_builder( zone(), shared_info, feedback_vector, BailoutId::None(), jsgraph(), - call.frequency(), source_positions_, native_context(), inlining_id, + frequency, source_positions_, native_context(), inlining_id, flags, false, info_->is_analyze_environment_liveness()); graph_builder.CreateGraph(); diff --git a/deps/v8/src/compiler/js-operator.cc b/deps/v8/src/compiler/js-operator.cc index 8fe10bb36a83d7..04feec6827aad0 100644 --- a/deps/v8/src/compiler/js-operator.cc +++ b/deps/v8/src/compiler/js-operator.cc @@ -794,7 +794,8 @@ const Operator* JSOperatorBuilder::CallForwardVarargs(size_t arity, parameters); // parameter } -const Operator* JSOperatorBuilder::Call(size_t arity, CallFrequency frequency, +const Operator* JSOperatorBuilder::Call(size_t arity, + CallFrequency const& frequency, VectorSlotPair const& feedback, ConvertReceiverMode convert_mode, SpeculationMode speculation_mode) { @@ -818,8 +819,8 @@ const Operator* JSOperatorBuilder::CallWithArrayLike(CallFrequency frequency) { } const Operator* JSOperatorBuilder::CallWithSpread( - uint32_t arity, CallFrequency frequency, VectorSlotPair const& feedback, - SpeculationMode speculation_mode) { + uint32_t arity, CallFrequency const& frequency, + VectorSlotPair const& feedback, SpeculationMode speculation_mode) { DCHECK_IMPLIES(speculation_mode == SpeculationMode::kAllowSpeculation, feedback.IsValid()); CallParameters parameters(arity, frequency, feedback, diff --git a/deps/v8/src/compiler/js-operator.h b/deps/v8/src/compiler/js-operator.h index 6d89e5ac09a9de..ac09ed229bd7b2 100644 --- a/deps/v8/src/compiler/js-operator.h +++ b/deps/v8/src/compiler/js-operator.h @@ -160,7 +160,7 @@ CallForwardVarargsParameters const& CallForwardVarargsParametersOf( // used as a parameter by JSCall and JSCallWithSpread operators. class CallParameters final { public: - CallParameters(size_t arity, CallFrequency frequency, + CallParameters(size_t arity, CallFrequency const& frequency, VectorSlotPair const& feedback, ConvertReceiverMode convert_mode, SpeculationMode speculation_mode) @@ -171,7 +171,7 @@ class CallParameters final { feedback_(feedback) {} size_t arity() const { return ArityField::decode(bit_field_); } - CallFrequency frequency() const { return frequency_; } + CallFrequency const& frequency() const { return frequency_; } ConvertReceiverMode convert_mode() const { return ConvertReceiverModeField::decode(bit_field_); } @@ -721,13 +721,13 @@ class V8_EXPORT_PRIVATE JSOperatorBuilder final const Operator* CallForwardVarargs(size_t arity, uint32_t start_index); const Operator* Call( - size_t arity, CallFrequency frequency = CallFrequency(), + size_t arity, CallFrequency const& frequency = CallFrequency(), VectorSlotPair const& feedback = VectorSlotPair(), ConvertReceiverMode convert_mode = ConvertReceiverMode::kAny, SpeculationMode speculation_mode = SpeculationMode::kDisallowSpeculation); const Operator* CallWithArrayLike(CallFrequency frequency); const Operator* CallWithSpread( - uint32_t arity, CallFrequency frequency = CallFrequency(), + uint32_t arity, CallFrequency const& frequency = CallFrequency(), VectorSlotPair const& feedback = VectorSlotPair(), SpeculationMode speculation_mode = SpeculationMode::kDisallowSpeculation); const Operator* CallRuntime(Runtime::FunctionId id); diff --git a/deps/v8/src/compiler/pipeline.cc b/deps/v8/src/compiler/pipeline.cc index 779457bcf76c34..0bc4bdd41428e2 100644 --- a/deps/v8/src/compiler/pipeline.cc +++ b/deps/v8/src/compiler/pipeline.cc @@ -1059,10 +1059,11 @@ struct GraphBuilderPhase { if (data->info()->is_bailout_on_uninitialized()) { flags |= JSTypeHintLowering::kBailoutOnUninitialized; } + CallFrequency frequency = CallFrequency(1.0f); BytecodeGraphBuilder graph_builder( temp_zone, data->info()->shared_info(), handle(data->info()->closure()->feedback_vector()), - data->info()->osr_offset(), data->jsgraph(), CallFrequency(1.0f), + data->info()->osr_offset(), data->jsgraph(), frequency, data->source_positions(), data->native_context(), SourcePosition::kNotInlined, flags, true, data->info()->is_analyze_environment_liveness()); diff --git a/deps/v8/src/profiler/cpu-profiler.cc b/deps/v8/src/profiler/cpu-profiler.cc index 79606dc812ebda..ff510c040e86cf 100644 --- a/deps/v8/src/profiler/cpu-profiler.cc +++ b/deps/v8/src/profiler/cpu-profiler.cc @@ -368,8 +368,11 @@ void CpuProfiler::StartProcessorIfNotStarted() { // Disable logging when using the new implementation. saved_is_logging_ = logger->is_logging_; logger->is_logging_ = false; + + bool codemap_needs_initialization = false; if (!generator_) { generator_.reset(new ProfileGenerator(profiles_.get())); + codemap_needs_initialization = true; CreateEntriesForRuntimeCallStats(); } processor_.reset(new ProfilerEventsProcessor(isolate_, generator_.get(), @@ -382,12 +385,14 @@ void CpuProfiler::StartProcessorIfNotStarted() { isolate_->set_is_profiling(true); // Enumerate stuff we already have in the heap. DCHECK(isolate_->heap()->HasBeenSetUp()); - if (!FLAG_prof_browser_mode) { - logger->LogCodeObjects(); + if (codemap_needs_initialization) { + if (!FLAG_prof_browser_mode) { + logger->LogCodeObjects(); + } + logger->LogCompiledFunctions(); + logger->LogAccessorCallbacks(); + LogBuiltins(); } - logger->LogCompiledFunctions(); - logger->LogAccessorCallbacks(); - LogBuiltins(); // Enable stack sampling. processor_->AddCurrentStack(isolate_); processor_->StartSynchronously(); diff --git a/deps/v8/src/torque/file-visitor.h b/deps/v8/src/torque/file-visitor.h index 5aac1bad46d6a4..45820c5b6bf8ef 100644 --- a/deps/v8/src/torque/file-visitor.h +++ b/deps/v8/src/torque/file-visitor.h @@ -21,6 +21,10 @@ namespace torque { class FileVisitor { public: +#if defined(__GNUC__) && V8_OS_AIX + // prevent non-virtual-dtor gcc error on Aix + virtual ~FileVisitor() = default; +#endif explicit FileVisitor(GlobalContext& global_context) : global_context_(global_context), declarations_(global_context.declarations()), diff --git a/deps/v8/test/cctest/cctest.status b/deps/v8/test/cctest/cctest.status index da069e0a269386..85e2554f5ec77f 100644 --- a/deps/v8/test/cctest/cctest.status +++ b/deps/v8/test/cctest/cctest.status @@ -390,6 +390,7 @@ # TODO(ppc): Implement load/store reverse byte instructions 'test-run-wasm-simd/RunWasmCompiled_SimdLoadStoreLoad': [SKIP], 'test-run-wasm-simd/RunWasm_SimdLoadStoreLoad': [SKIP], + 'test-run-wasm-simd/RunWasm_SimdLoadStoreLoad_turbofan': [SKIP], }], # 'system == aix or (arch == ppc64 and byteorder == big)' diff --git a/deps/v8/third_party/antlr4/BUILD.gn b/deps/v8/third_party/antlr4/BUILD.gn index bd58a1804d1558..8d3d98a399f0f6 100644 --- a/deps/v8/third_party/antlr4/BUILD.gn +++ b/deps/v8/third_party/antlr4/BUILD.gn @@ -9,6 +9,9 @@ config("antlr-compatibility") { "-Wno-unused-but-set-variable", ] } + if (current_os == "aix") { + cflags += [ "-fdollars-in-identifiers" ] + } } source_set("antlr4") { diff --git a/deps/v8/tools/mb/mb.py b/deps/v8/tools/mb/mb.py index b2ae0c763f6a15..cbb5b5dd6d5bd6 100755 --- a/deps/v8/tools/mb/mb.py +++ b/deps/v8/tools/mb/mb.py @@ -835,7 +835,13 @@ def GNCmd(self, subcommand, path, *args): else: subdir, exe = 'win', 'gn.exe' - gn_path = self.PathJoin(self.chromium_src_dir, 'buildtools', subdir, exe) + arch = platform.machine() + if (arch.startswith('s390') or arch.startswith('ppc') or + self.platform.startswith('aix')): + # use gn in PATH + gn_path = 'gn' + else: + gn_path = self.PathJoin(self.chromium_src_dir, 'buildtools', subdir, exe) return [gn_path, subcommand, path] + list(args) diff --git a/deps/v8/tools/profile.js b/deps/v8/tools/profile.js index cddadaaf53121a..74b4b3bf663f66 100644 --- a/deps/v8/tools/profile.js +++ b/deps/v8/tools/profile.js @@ -1002,33 +1002,10 @@ JsonProfile.prototype.addSourcePositions = function( }; }; -function unescapeString(s) { - s = s.split("\\"); - for (var i = 1; i < s.length; i++) { - if (s[i] === "") { - // Double backslash. - s[i] = "\\"; - } else if (i > 0 && s[i].startsWith("x")) { - // Escaped Ascii character. - s[i] = String.fromCharCode(parseInt(s[i].substring(1, 3), 16)) + - s[i].substring(3); - } else if (i > 0 && s[i].startsWith("u")) { - // Escaped unicode character. - s[i] = String.fromCharCode(parseInt(s[i].substring(1, 5), 16)) + - s[i].substring(5); - } else { - if (i > 0 && s[i - 1] !== "\\") { - printErr("Malformed source string"); - } - } - } - return s.join(""); -} - JsonProfile.prototype.addScriptSource = function(script, url, source) { this.scripts_[script] = { - name : unescapeString(url), - source : unescapeString(source) + name : url, + source : source }; }; diff --git a/doc/STYLE_GUIDE.md b/doc/STYLE_GUIDE.md index 5d0f4f14eb2a22..c274f6023ede02 100644 --- a/doc/STYLE_GUIDE.md +++ b/doc/STYLE_GUIDE.md @@ -24,8 +24,6 @@ clause — a subject, verb, and an object. * Outside of the wrapping element if the wrapping element contains only a fragment of a clause. -* Place end-of-sentence punctuation inside wrapping elements — periods go - inside parentheses and quotes, not after. * Documents must start with a level-one heading. * Prefer affixing links to inlining links — prefer `[a link][]` to `[a link](http://example.com)`. @@ -53,10 +51,6 @@ * References to constructor instances should use camelCase. * References to methods should be used with parentheses: for example, `socket.end()` instead of `socket.end`. -* To draw special attention to a note, adhere to the following guidelines: - * Make the "Note:" label italic, i.e. `*Note*:`. - * Use a capital letter after the "Note:" label. - * Preferably, make the note a new paragraph for better visual distinction. * Function arguments or object properties should use the following format: * ``` * `name` {type|type2} Optional description. **Default:** `value`. ``` @@ -71,6 +65,8 @@ * NOT OK: Javascript, Google's v8 +* Use _Node.js_ and not _Node_, _NodeJS_, or similar variants. + * When referring to the executable, _`node`_ is acceptable. See also API documentation structure overview in [doctools README][]. diff --git a/doc/api/addons.md b/doc/api/addons.md index b2c52d5128b5bc..757f24c5194271 100644 --- a/doc/api/addons.md +++ b/doc/api/addons.md @@ -587,6 +587,7 @@ property `msg` that echoes the string passed to `createObject()`: namespace demo { +using v8::Context; using v8::FunctionCallbackInfo; using v8::Isolate; using v8::Local; @@ -596,9 +597,11 @@ using v8::Value; void CreateObject(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); + Local context = isolate->GetCurrentContext(); Local obj = Object::New(isolate); - obj->Set(String::NewFromUtf8(isolate, "msg"), args[0]->ToString(isolate)); + obj->Set(String::NewFromUtf8(isolate, "msg"), + args[0]->ToString(context).ToLocalChecked()); args.GetReturnValue().Set(obj); } @@ -1078,6 +1081,7 @@ that can take two `MyObject` objects as input arguments: namespace demo { +using v8::Context; using v8::FunctionCallbackInfo; using v8::Isolate; using v8::Local; @@ -1092,11 +1096,12 @@ void CreateObject(const FunctionCallbackInfo& args) { void Add(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); + Local context = isolate->GetCurrentContext(); MyObject* obj1 = node::ObjectWrap::Unwrap( - args[0]->ToObject(isolate)); + args[0]->ToObject(context).ToLocalChecked()); MyObject* obj2 = node::ObjectWrap::Unwrap( - args[1]->ToObject(isolate)); + args[1]->ToObject(context).ToLocalChecked()); double sum = obj1->value() + obj2->value(); args.GetReturnValue().Set(Number::New(isolate, sum)); diff --git a/doc/api/assert.md b/doc/api/assert.md index 4800bed4e8239d..50519b831c9a2c 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -418,10 +418,10 @@ the function does not return a promise, `assert.doesNotReject()` will return a rejected `Promise` with an [`ERR_INVALID_RETURN_VALUE`][] error. In both cases the error handler is skipped. -Please note: Using `assert.doesNotReject()` is actually not useful because there -is little benefit by catching a rejection and then rejecting it again. Instead, -consider adding a comment next to the specific code path that should not reject -and keep error messages as expressive as possible. +Using `assert.doesNotReject()` is actually not useful because there is little +benefit in catching a rejection and then rejecting it again. Instead, consider +adding a comment next to the specific code path that should not reject and keep +error messages as expressive as possible. If specified, `error` can be a [`Class`][], [`RegExp`][] or a validation function. See [`assert.throws()`][] for more details. @@ -464,8 +464,8 @@ changes: Asserts that the function `fn` does not throw an error. -Please note: Using `assert.doesNotThrow()` is actually not useful because there -is no benefit by catching an error and then rethrowing it. Instead, consider +Using `assert.doesNotThrow()` is actually not useful because there +is no benefit in catching an error and then rethrowing it. Instead, consider adding a comment next to the specific code path that should not throw and keep error messages as expressive as possible. diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 252ded2ca41b2c..f0752a5892c362 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -704,6 +704,8 @@ alternative. #### asyncResource.emitDestroy() +* Returns: {AsyncResource} A reference to `asyncResource`. + Call all `destroy` hooks. This should only ever be called once. An error will be thrown if it is called more than once. This **must** be manually called. If the resource is left to be collected by the GC then the `destroy` hooks will diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 56999a1955d0a1..897512ae000805 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -1933,6 +1933,14 @@ buf2.swap16(); // Throws ERR_INVALID_BUFFER_SIZE ``` +One convenient use of `buf.swap16()` is to perform a fast in-place conversion +between UTF-16 little-endian and UTF-16 big-endian: + +```js +const buf = Buffer.from('This is little-endian UTF-16', 'utf16le'); +buf.swap16(); // Convert to big-endian UTF-16 text. +``` + ### buf.swap32() @@ -525,6 +525,9 @@ malformed, but any errors are otherwise ignored. Note that neither the well known nor extra certificates are used when the `ca` options property is explicitly specified for a TLS or HTTPS client or server. +This environment variable is ignored when `node` runs as setuid root or +has Linux file capabilities set. + ### `NODE_ICU_DATA=file` +> Stability: 0 - Deprecated + The default encoding to use for functions that can take either strings or [buffers][`Buffer`]. The default value is `'buffer'`, which makes methods default to [`Buffer`][] objects. @@ -1315,6 +1317,8 @@ added: v6.0.0 deprecated: v10.0.0 --> +> Stability: 0 - Deprecated + Property for checking and controlling whether a FIPS compliant crypto provider is currently in use. Setting to true requires a FIPS build of Node.js. @@ -1551,6 +1555,7 @@ changes: * `generator` {number | string | Buffer | TypedArray | DataView} **Default:** `2` * `generatorEncoding` {string} +* Returns: {DiffieHellman} Creates a `DiffieHellman` key exchange object using the supplied `prime` and an optional specific `generator`. @@ -1574,6 +1579,7 @@ added: v0.5.0 * `primeLength` {number} * `generator` {number | string | Buffer | TypedArray | DataView} **Default:** `2` +* Returns: {DiffieHellman} Creates a `DiffieHellman` key exchange object and generates a prime of `primeLength` bits using an optional specific numeric `generator`. @@ -1584,6 +1590,7 @@ If `generator` is not specified, the value `2` is used. added: v0.11.14 --> * `curveName` {string} +* Returns: {ECDH} Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a predefined curve specified by the `curveName` string. Use @@ -1836,7 +1843,7 @@ console.log(curves); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...] added: v0.7.5 --> * `groupName` {string} -* Returns: {Object} +* Returns: {DiffieHellman} Creates a predefined `DiffieHellman` key exchange object. The supported groups are: `'modp1'`, `'modp2'`, `'modp5'` (defined in diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 01e6afeeb261cd..22f40da01c4fe1 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -321,7 +321,7 @@ changes: Type: End-of-Life Calling an asynchronous function without a callback throws a `TypeError` -in Node.js 10.0.0 onwards. (See https://github.com/nodejs/node/pull/12562.) +in Node.js 10.0.0 onwards. (See .) ### DEP0014: fs.read legacy String interface @@ -1697,7 +1697,7 @@ changes: Type: End-of-Life The AsyncHooks Sensitive API was never documented and had various minor issues. -(See https://github.com/nodejs/node/issues/15572.) Use the `AsyncResource` +(See .) Use the `AsyncResource` API instead. @@ -1717,8 +1717,8 @@ changes: Type: End-of-Life `runInAsyncIdScope` doesn't emit the `'before'` or `'after'` event and can thus -cause a lot of issues. See https://github.com/nodejs/node/issues/14328 for more -details. +cause a lot of issues. See for +more details. ### DEP0089: require('assert') @@ -1875,7 +1875,7 @@ to unrecoverable errors. Use [`asyncResource.runInAsyncScope()`][] API instead which provides a much safer, and more convenient, alternative. See -https://github.com/nodejs/node/pull/18513 for more details. + for more details. ### DEP0099: async context-unaware node::MakeCallback C++ APIs diff --git a/doc/api/dgram.md b/doc/api/dgram.md index fd99401868d54e..7db8cdf3650342 100644 --- a/doc/api/dgram.md +++ b/doc/api/dgram.md @@ -95,6 +95,24 @@ Tells the kernel to join a multicast group at the given `multicastAddress` and one interface and will add membership to it. To add membership to every available interface, call `addMembership` multiple times, once per interface. +When sharing a UDP socket across multiple `cluster` workers, the +`socket.addMembership()` function must be called only once or an +`EADDRINUSE` error will occur: + +```js +const cluster = require('cluster'); +const dgram = require('dgram'); +if (cluster.isMaster) { + cluster.fork(); // Works ok. + cluster.fork(); // Fails with EADDRINUSE. +} else { + const s = dgram.createSocket('udp4'); + s.bind(1234, () => { + s.addMembership('224.0.0.114'); + }); +} +``` + ### socket.address() + + + +* {Object} + +The object that acts as the namespace for all W3C +[WebAssembly][webassembly-org] related functionality. See the +[Mozilla Developer Network][webassembly-mdn] for usage and compatibility. + [`__dirname`]: modules.html#modules_dirname [`__filename`]: modules.html#modules_filename [`clearImmediate`]: timers.html#timers_clearimmediate_immediate @@ -175,3 +188,5 @@ The WHATWG `URLSearchParams` class. See the [`URLSearchParams`][] section. [built-in objects]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects [module system documentation]: modules.html [timers]: timers.html +[webassembly-mdn]: https://developer.mozilla.org/en-US/docs/WebAssembly +[webassembly-org]: https://webassembly.org diff --git a/doc/api/http.md b/doc/api/http.md index c34e6cded4d5a7..562830ee589385 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -599,13 +599,13 @@ The type of the return value depends on the arguments provided to ```js request.setHeader('content-type', 'text/html'); request.setHeader('Content-Length', Buffer.byteLength(body)); -request.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']); +request.setHeader('Cookie', ['type=ninja', 'language=javascript']); const contentType = request.getHeader('Content-Type'); // contentType is 'text/html' const contentLength = request.getHeader('Content-Length'); // contentLength is of type number -const setCookie = request.getHeader('set-cookie'); -// setCookie is of type string[] +const cookie = request.getHeader('Cookie'); +// cookie is of type string[] ``` ### request.maxHeadersCount @@ -649,7 +649,7 @@ request.setHeader('Content-Type', 'application/json'); or ```js -request.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']); +request.setHeader('Cookie', ['type=ninja', 'language=javascript']); ``` ### request.setNoDelay([noDelay]) @@ -1496,6 +1496,34 @@ added: v10.1.0 The `message.aborted` property will be `true` if the request has been aborted. +### message.complete + + +* {boolean} + +The `message.complete` property will be `true` if a complete HTTP message has +been received and successfully parsed. + +This property is particularly useful as a means of determining if a client or +server fully transmitted a message before a connection was terminated: + +```js +const req = http.request({ + host: '127.0.0.1', + port: 8080, + method: 'POST' +}, (res) => { + res.resume(); + res.on('end', () => { + if (!res.complete) + console.error( + 'The connection was terminated while the message was still being sent'); + }); +}); +``` + ### message.destroy([error]) * `callback` {Function} +* Returns: {https.Server} See [`server.close()`][`http.close()`] from the HTTP module for details. @@ -49,6 +50,7 @@ added: v0.11.2 --> * `msecs` {number} **Default:** `120000` (2 minutes) * `callback` {Function} +* Returns: {https.Server} See [`http.Server#setTimeout()`][]. @@ -75,6 +77,7 @@ added: v0.3.4 * `options` {Object} Accepts `options` from [`tls.createServer()`][], [`tls.createSecureContext()`][] and [`http.createServer()`][]. * `requestListener` {Function} A listener to be added to the `'request'` event. +* Returns: {https.Server} ```js // curl -k https://localhost:8000/ diff --git a/doc/api/index.md b/doc/api/index.md index 5ba0da6a7fb5aa..4262191327ce60 100644 --- a/doc/api/index.md +++ b/doc/api/index.md @@ -61,4 +61,3 @@
* [GitHub Repo & Issue Tracker](https://github.com/nodejs/node) -* [Mailing List](https://groups.google.com/forum/#!forum/nodejs) diff --git a/doc/api/inspector.md b/doc/api/inspector.md index 92fcb0e03f89e4..02aa1ac1416acd 100644 --- a/doc/api/inspector.md +++ b/doc/api/inspector.md @@ -144,7 +144,7 @@ session.post('Runtime.evaluate', { expression: '2 + 2' }, The latest version of the V8 inspector protocol is published on the [Chrome DevTools Protocol Viewer][]. -Node inspector supports all the Chrome DevTools Protocol domains declared +Node.js inspector supports all the Chrome DevTools Protocol domains declared by V8. Chrome DevTools Protocol domain provides an interface for interacting with one of the runtime agents used to inspect the application state and listen to the run-time events. diff --git a/doc/api/modules.md b/doc/api/modules.md index 59c589e83ac233..c7d9d4b59c7726 100644 --- a/doc/api/modules.md +++ b/doc/api/modules.md @@ -376,8 +376,9 @@ Error: Cannot find module 'some-library' If the module identifier passed to `require()` is not a [core](#modules_core_modules) module, and does not begin with `'/'`, `'../'`, or `'./'`, then Node.js starts at the parent directory of the current module, and -adds `/node_modules`, and attempts to load the module from that location. Node -will not append `node_modules` to a path already ending in `node_modules`. +adds `/node_modules`, and attempts to load the module from that location. +Node.js will not append `node_modules` to a path already ending in +`node_modules`. If it is not found there, then it moves to the parent directory, and so on, until the root of the file system is reached. @@ -552,7 +553,22 @@ added: v0.1.13 * {Function} -To require modules. +Used to import modules, `JSON`, and local files. Modules can be imported +from `node_modules`. Local modules and JSON files can be imported using +a relative path (e.g. `./`, `./foo`, `./bar/baz`, `../foo`) that will be +resolved against the directory named by [`__dirname`][] (if defined) or +the current working directory. + +```js +// Importing a local module: +const myLocalModule = require('./path/myLocalModule'); + +// Importing a JSON file: +const jsonData = require('./path/filename.json'); + +// Importing a module from node_modules or Node.js built-in module: +const crypto = require('crypto'); +``` #### require.cache * `data` {string|Buffer|Uint8Array} * `encoding` {string} Only used when data is `string`. **Default:** `'utf8'`. +* `callback` {Function} Optional callback for when the socket is finished. * Returns: {net.Socket} The socket itself. Half-closes the socket. i.e., it sends a FIN packet. It is possible the @@ -885,6 +886,7 @@ added: v0.7.0 --> * `options` {Object} * `connectListener` {Function} + Alias to [`net.createConnection(options[, connectListener])`][`net.createConnection(options)`]. @@ -1027,10 +1029,6 @@ then returns the `net.Socket` that starts the connection. -* `options` {Object} -* `connectionListener` {Function} - -Creates a new TCP or [IPC][] server. * `options` {Object} * `allowHalfOpen` {boolean} Indicates whether half-opened TCP @@ -1041,6 +1039,8 @@ Creates a new TCP or [IPC][] server. [`'connection'`][] event. * Returns: {net.Server} +Creates a new TCP or [IPC][] server. + If `allowHalfOpen` is set to `true`, when the other end of the socket sends a FIN packet, the server will only send a FIN packet back when [`socket.end()`][] is explicitly called, until then the connection is @@ -1168,7 +1168,7 @@ Returns `true` if input is a version 6 IP address, otherwise returns `false`. [`socket.connect(path)`]: #net_socket_connect_path_connectlistener [`socket.connect(port, host)`]: #net_socket_connect_port_host_connectlistener [`socket.destroy()`]: #net_socket_destroy_exception -[`socket.end()`]: #net_socket_end_data_encoding +[`socket.end()`]: #net_socket_end_data_encoding_callback [`socket.pause()`]: #net_socket_pause [`socket.resume()`]: #net_socket_resume [`socket.setEncoding()`]: #net_socket_setencoding_encoding diff --git a/doc/api/path.md b/doc/api/path.md index 2a1f06028ee6f4..a5cd310690e5cc 100644 --- a/doc/api/path.md +++ b/doc/api/path.md @@ -18,9 +18,7 @@ on which a Node.js application is running. Specifically, when running on a Windows operating system, the `path` module will assume that Windows-style paths are being used. -For example, using the `path.basename()` function with the Windows file path -`C:\temp\myfile.html`, will yield different results when running on POSIX than -when run on Windows: +So using `path.basename()` might yield different results on POSIX and Windows: On POSIX: @@ -56,7 +54,7 @@ path.posix.basename('/tmp/myfile.html'); // Returns: 'myfile.html' ``` -*Note:* On Windows Node.js follows the concept of per-drive working directory. +On Windows Node.js follows the concept of per-drive working directory. This behavior can be observed when using a drive path without a backslash. For example, `path.resolve('c:\\')` can potentially return a different result than `path.resolve('c:')`. For more information, see diff --git a/doc/api/process.md b/doc/api/process.md index 5139ad95d88d21..2eac1160586af1 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -114,7 +114,7 @@ The `'multipleResolves'` event is emitted whenever a `Promise` has been either: * Rejected after resolve. * Resolved after reject. -This is useful for tracking errors in your application while using the promise +This is useful for tracking errors in an application while using the promise constructor. Otherwise such mistakes are silently swallowed due to being in a dead zone. @@ -207,9 +207,9 @@ exception bubbles all the way back to the event loop. By default, Node.js handles such exceptions by printing the stack trace to `stderr` and exiting with code 1, overriding any previously set [`process.exitCode`][]. Adding a handler for the `'uncaughtException'` event overrides this default -behavior. You may also change the [`process.exitCode`][] in -`'uncaughtException'` handler which will result in process exiting with -provided exit code, otherwise in the presence of such handler the process will +behavior. Alternatively, change the [`process.exitCode`][] in the +`'uncaughtException'` handler which will result in the process exiting with the +provided exit code. Otherwise, in the presence of such handler the process will exit with 0. The listener function is called with the `Error` object passed as the only diff --git a/doc/api/repl.md b/doc/api/repl.md index 98c3f66839da83..09fe9ebcbece61 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -453,7 +453,7 @@ Returns `true` if `keyword` is a valid keyword, otherwise `false`. added: v0.1.91 changes: - version: v10.0.0 - pr-url: https://github.com/nodejs/node/pull/v10.0.0 + pr-url: https://github.com/nodejs/node/pull/19187 description: The `REPL_MAGIC_MODE` `replMode` was removed. - version: v5.8.0 pr-url: https://github.com/nodejs/node/pull/5388 @@ -499,6 +499,7 @@ changes: * `breakEvalOnSigint` - Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is pressed. This cannot be used together with a custom `eval` function. **Default:** `false`. +* Returns: {repl.REPLServer} The `repl.start()` method creates and starts a [`repl.REPLServer`][] instance. @@ -619,10 +620,10 @@ possible to connect to a long-running Node.js process without restarting it. For an example of running a "full-featured" (`terminal`) REPL over a `net.Server` and `net.Socket` instance, see: -[https://gist.github.com/TooTallNate/2209310](https://gist.github.com/TooTallNate/2209310). +. For an example of running a REPL instance over [curl(1)][], see: -[https://gist.github.com/TooTallNate/2053342](https://gist.github.com/TooTallNate/2053342). +. [`'uncaughtException'`]: process.html#process_event_uncaughtexception [`--experimental-repl-await`]: cli.html#cli_experimental_repl_await diff --git a/doc/api/synopsis.md b/doc/api/synopsis.md index d22d684bfb0b8f..efbbf54a1a7fed 100644 --- a/doc/api/synopsis.md +++ b/doc/api/synopsis.md @@ -14,7 +14,7 @@ An example of a [web server][] written with Node.js which responds with Commands displayed in this document are shown starting with `$` or `>` to replicate how they would appear in a user's terminal. -Do not include the `$` and `>` character they are there to +Do not include the `$` and `>` characters. They are there to indicate the start of each command. There are many tutorials and examples that follow this @@ -27,8 +27,8 @@ the output of the previous command. Firstly, make sure to have downloaded and installed Node.js. See [this guide][] for further install information. -Now, create an empty project folder called `projects`, navigate into it: -Project folder can be named base on user's current project title but +Now, create an empty project folder called `projects`, then navigate into it. +The project folder can be named based on the user's current project title, but this example will use `projects` as the project folder. Linux and Mac: @@ -60,7 +60,7 @@ hyphens (`-`) or underscores (`_`) to separate multiple words in filenames. Open `hello-world.js` in any preferred text editor and -paste in the following content. +paste in the following content: ```js const http = require('http'); diff --git a/doc/api/tls.md b/doc/api/tls.md index fe8bfa27ef6ca2..30dfb9c31e01fe 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -378,6 +378,7 @@ added: v0.3.2 * `callback` {Function} A listener callback that will be registered to listen for the server instance's `'close'` event. +* Returns: {tls.Server} The `server.close()` method stops the server from accepting new connections. @@ -566,7 +567,7 @@ field which always contains the value `'TLSv1/SSLv3'`. For example: `{ name: 'AES256-SHA', version: 'TLSv1/SSLv3' }`. See `SSL_CIPHER_get_name()` in -https://www.openssl.org/docs/man1.1.0/ssl/SSL_CIPHER_get_name.html for more + for more information. ### tlsSocket.getEphemeralKeyInfo() @@ -677,13 +678,12 @@ be returned for server sockets or disconnected client sockets. Example responses include: -* `SSLv3` * `TLSv1` * `TLSv1.1` * `TLSv1.2` * `unknown` -See https://www.openssl.org/docs/man1.1.0/ssl/SSL_get_version.html for more +See for more information. ### tlsSocket.getSession() @@ -891,7 +891,7 @@ changes: first byte is the length of the next protocol name. Passing an array is usually much simpler, e.g. `['hello', 'world']`. * `servername`: {string} Server name for the SNI (Server Name Indication) TLS - extension. + extension. It must be a host name, and not an IP address. * `checkServerIdentity(servername, cert)` {Function} A callback function to be used (instead of the builtin `tls.checkServerIdentity()` function) when checking the server's hostname (or the provided `servername` when @@ -912,6 +912,7 @@ changes: * ...: [`tls.createSecureContext()`][] options that are used if the `secureContext` option is missing, otherwise they are ignored. * `callback` {Function} +* Returns: {tls.TLSSocket} The `callback` function, if specified, will be added as a listener for the [`'secureConnect'`][] event. @@ -986,6 +987,7 @@ added: v0.11.3 * `path` {string} Default value for `options.path`. * `options` {Object} See [`tls.connect()`][]. * `callback` {Function} See [`tls.connect()`][]. +* Returns: {tls.TLSSocket} Same as [`tls.connect()`][] except that `path` can be provided as an argument instead of an option. @@ -1001,6 +1003,7 @@ added: v0.11.3 * `host` {string} Default value for `options.host`. * `options` {Object} See [`tls.connect()`][]. * `callback` {Function} See [`tls.connect()`][]. +* Returns: {tls.TLSSocket} Same as [`tls.connect()`][] except that `port` and `host` can be provided as arguments instead of options. @@ -1173,6 +1176,7 @@ changes: * ...: Any [`tls.createSecureContext()`][] option can be provided. For servers, the identity options (`pfx` or `key`/`cert`) are usually required. * `secureConnectionListener` {Function} +* Returns: {tls.Server} Creates a new [`tls.Server`][]. The `secureConnectionListener`, if provided, is automatically set as a listener for the [`'secureConnection'`][] event. diff --git a/doc/api/url.md b/doc/api/url.md index cd817bf304b19e..84f9b3684ff0b2 100644 --- a/doc/api/url.md +++ b/doc/api/url.md @@ -26,31 +26,31 @@ backwards compatibility with existing applications. New application code should use the WHATWG API. A comparison between the WHATWG and Legacy APIs is provided below. Above the URL -`'http://user:pass@sub.host.com:8080/p/a/t/h?query=string#hash'`, properties of -an object returned by the legacy `url.parse()` are shown. Below it are +`'http://user:pass@sub.example.com:8080/p/a/t/h?query=string#hash'`, properties +of an object returned by the legacy `url.parse()` are shown. Below it are properties of a WHATWG `URL` object. WHATWG URL's `origin` property includes `protocol` and `host`, but not `username` or `password`. ```txt -┌─────────────────────────────────────────────────────────────────────────────────────────────┐ -│ href │ -├──────────┬──┬─────────────────────┬─────────────────────┬───────────────────────────┬───────┤ -│ protocol │ │ auth │ host │ path │ hash │ -│ │ │ ├──────────────┬──────┼──────────┬────────────────┤ │ -│ │ │ │ hostname │ port │ pathname │ search │ │ -│ │ │ │ │ │ ├─┬──────────────┤ │ -│ │ │ │ │ │ │ │ query │ │ -" https: // user : pass @ sub.host.com : 8080 /p/a/t/h ? query=string #hash " -│ │ │ │ │ hostname │ port │ │ │ │ -│ │ │ │ ├──────────────┴──────┤ │ │ │ -│ protocol │ │ username │ password │ host │ │ │ │ -├──────────┴──┼──────────┴──────────┼─────────────────────┤ │ │ │ -│ origin │ │ origin │ pathname │ search │ hash │ -├─────────────┴─────────────────────┴─────────────────────┴──────────┴────────────────┴───────┤ -│ href │ -└─────────────────────────────────────────────────────────────────────────────────────────────┘ +┌────────────────────────────────────────────────────────────────────────────────────────────────┐ +│ href │ +├──────────┬──┬─────────────────────┬────────────────────────┬───────────────────────────┬───────┤ +│ protocol │ │ auth │ host │ path │ hash │ +│ │ │ ├─────────────────┬──────┼──────────┬────────────────┤ │ +│ │ │ │ hostname │ port │ pathname │ search │ │ +│ │ │ │ │ │ ├─┬──────────────┤ │ +│ │ │ │ │ │ │ │ query │ │ +" https: // user : pass @ sub.example.com : 8080 /p/a/t/h ? query=string #hash " +│ │ │ │ │ hostname │ port │ │ │ │ +│ │ │ │ ├─────────────────┴──────┤ │ │ │ +│ protocol │ │ username │ password │ host │ │ │ │ +├──────────┴──┼──────────┴──────────┼────────────────────────┤ │ │ │ +│ origin │ │ origin │ pathname │ search │ hash │ +├─────────────┴─────────────────────┴────────────────────────┴──────────┴────────────────┴───────┤ +│ href │ +└────────────────────────────────────────────────────────────────────────────────────────────────┘ (all spaces in the "" line should be ignored — they are purely for formatting) ``` @@ -58,7 +58,7 @@ Parsing the URL string using the WHATWG API: ```js const myURL = - new URL('https://user:pass@sub.host.com:8080/p/a/t/h?query=string#hash'); + new URL('https://user:pass@sub.example.com:8080/p/a/t/h?query=string#hash'); ``` Parsing the URL string using the Legacy API: @@ -66,7 +66,7 @@ Parsing the URL string using the Legacy API: ```js const url = require('url'); const myURL = - url.parse('https://user:pass@sub.host.com:8080/p/a/t/h?query=string#hash'); + url.parse('https://user:pass@sub.example.com:8080/p/a/t/h?query=string#hash'); ``` ## The WHATWG URL API @@ -120,8 +120,8 @@ Unicode characters appearing within the hostname of `input` will be automatically converted to ASCII using the [Punycode][] algorithm. ```js -const myURL = new URL('https://你好你好'); -// https://xn--6qqa088eba/ +const myURL = new URL('https://測試'); +// https://xn--g6w251d/ ``` This feature is only available if the `node` executable was compiled with @@ -132,23 +132,23 @@ and a `base` is provided, it is advised to validate that the `origin` of the `URL` object is what is expected. ```js -let myURL = new URL('http://anotherExample.org/', 'https://example.org/'); -// http://anotherexample.org/ +let myURL = new URL('http://Example.com/', 'https://example.org/'); +// http://example.com/ -myURL = new URL('https://anotherExample.org/', 'https://example.org/'); -// https://anotherexample.org/ +myURL = new URL('https://Example.com/', 'https://example.org/'); +// https://example.com/ -myURL = new URL('foo://anotherExample.org/', 'https://example.org/'); -// foo://anotherExample.org/ +myURL = new URL('foo://Example.com/', 'https://example.org/'); +// foo://Example.com/ -myURL = new URL('http:anotherExample.org/', 'https://example.org/'); -// http://anotherexample.org/ +myURL = new URL('http:Example.com/', 'https://example.org/'); +// http://example.com/ -myURL = new URL('https:anotherExample.org/', 'https://example.org/'); -// https://example.org/anotherExample.org/ +myURL = new URL('https:Example.com/', 'https://example.org/'); +// https://example.org/Example.com/ -myURL = new URL('foo:anotherExample.org/', 'https://example.org/'); -// foo:anotherExample.org/ +myURL = new URL('foo:Example.com/', 'https://example.org/'); +// foo:Example.com/ ``` #### url.hash @@ -249,12 +249,12 @@ console.log(myURL.origin); ``` ```js -const idnURL = new URL('https://你好你好'); +const idnURL = new URL('https://測試'); console.log(idnURL.origin); -// Prints https://xn--6qqa088eba +// Prints https://xn--g6w251d console.log(idnURL.hostname); -// Prints xn--6qqa088eba +// Prints xn--g6w251d ``` #### url.password @@ -929,16 +929,16 @@ any way. The `url.format(URL[, options])` method allows for basic customization of the output. ```js -const myURL = new URL('https://a:b@你好你好?abc#foo'); +const myURL = new URL('https://a:b@測試?abc#foo'); console.log(myURL.href); -// Prints https://a:b@xn--6qqa088eba/?abc#foo +// Prints https://a:b@xn--g6w251d/?abc#foo console.log(myURL.toString()); -// Prints https://a:b@xn--6qqa088eba/?abc#foo +// Prints https://a:b@xn--g6w251d/?abc#foo console.log(url.format(myURL, { fragment: false, unicode: true, auth: false })); -// Prints 'https://你好你好/?abc' +// Prints 'https://測試/?abc' ``` ### url.pathToFileURL(path) @@ -991,21 +991,21 @@ For example: `'#hash'`. The `host` property is the full lower-cased host portion of the URL, including the `port` if specified. -For example: `'sub.host.com:8080'`. +For example: `'sub.example.com:8080'`. #### urlObject.hostname The `hostname` property is the lower-cased host name portion of the `host` component *without* the `port` included. -For example: `'sub.host.com'`. +For example: `'sub.example.com'`. #### urlObject.href The `href` property is the full URL string that was parsed with both the `protocol` and `host` components converted to lower-case. -For example: `'http://user:pass@sub.host.com:8080/p/a/t/h?query=string#hash'`. +For example: `'http://user:pass@sub.example.com:8080/p/a/t/h?query=string#hash'`. #### urlObject.path @@ -1265,11 +1265,11 @@ using the [Punycode][] algorithm. Note, however, that a hostname *may* contain *both* Punycode encoded and percent-encoded characters: ```js -const myURL = new URL('https://%CF%80.com/foo'); +const myURL = new URL('https://%CF%80.example.com/foo'); console.log(myURL.href); -// Prints https://xn--1xa.com/foo +// Prints https://xn--1xa.example.com/foo console.log(myURL.origin); -// Prints https://π.com +// Prints https://xn--1xa.example.com ``` [`Error`]: errors.html#errors_class_error diff --git a/doc/api/vm.md b/doc/api/vm.md index 6259b9b2ffd3f5..543f1642f0ff62 100644 --- a/doc/api/vm.md +++ b/doc/api/vm.md @@ -7,7 +7,7 @@ The `vm` module provides APIs for compiling and running code within V8 Virtual -Machine contexts. **Note that the `vm` module is not a security mechanism. Do +Machine contexts. **The `vm` module is not a security mechanism. Do not use it to run untrusted code**. The term "sandbox" is used throughout these docs simply to refer to a separate context, and does not confer any security guarantees. @@ -655,8 +655,8 @@ added: v10.10.0 data for the supplied source. * `produceCachedData` {boolean} Specifies whether to produce new cache data. **Default:** `false`. - * `parsingContext` {Object} The sandbox/context in which the said function - should be compiled in. + * `parsingContext` {Object} The [contextified][] sandbox in which the said + function should be compiled in. * `contextExtensions` {Object[]} An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling. **Default:** `[]`. diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index 37751c21bbb44d..b73787174cdc96 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -154,8 +154,8 @@ added: v10.5.0 --> Disables further sending of messages on either side of the connection. -This method can be called once you know that no further communication -will happen over this `MessagePort`. +This method can be called when no further communication will happen over this +`MessagePort`. ### port.postMessage(value[, transferList]) Node.js runtime Install the core [ProductName] runtime (node.exe). diff --git a/tools/msvs/msi/product.wxs b/tools/msvs/msi/product.wxs index ad48fedafd9ea0..e9e4e33751d254 100755 --- a/tools/msvs/msi/product.wxs +++ b/tools/msvs/msi/product.wxs @@ -72,8 +72,6 @@ - - - - - - - - - - @@ -205,12 +195,6 @@ Arguments='/k "[INSTALLDIR]nodevars.bat"' Show="normal" WorkingDirectory="INSTALLDIR"/> - - - - @@ -359,23 +340,6 @@ - - - - - - - - - - - - - - - 1 - - NOT Installed Installed AND PATCH @@ -386,6 +350,7 @@ 1 1 1 + 1 NOT Installed OR WixUI_InstallMode = "Change" Installed AND NOT PATCH Installed AND PATCH @@ -396,11 +361,7 @@ 1 Installed NOT Installed - 1 - 1 - 1 - NATIVETOOLSCHECKBOX = 1 - 1 + 1 diff --git a/tools/node-lint-md-cli-rollup/package-lock.json b/tools/node-lint-md-cli-rollup/package-lock.json index c3b14de9135465..49fcc015cd6829 100644 --- a/tools/node-lint-md-cli-rollup/package-lock.json +++ b/tools/node-lint-md-cli-rollup/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "acorn": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", - "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==", + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", + "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", "dev": true }, "ansi-regex": { @@ -30,256 +30,6 @@ "requires": { "micromatch": "^3.1.4", "normalize-path": "^2.1.1" - }, - "dependencies": { - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - } - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - } } }, "argparse": { @@ -291,13 +41,9 @@ } }, "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "dev": true, - "requires": { - "arr-flatten": "^1.0.1" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" }, "arr-flatten": { "version": "1.1.0", @@ -310,10 +56,9 @@ "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" }, "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", - "dev": true + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" }, "assign-symbols": { "version": "1.0.0", @@ -387,23 +132,13 @@ "is-data-descriptor": "^1.0.0", "kind-of": "^6.0.2" } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" } } }, "binary-extensions": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", - "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=" + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.12.0.tgz", + "integrity": "sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg==" }, "brace-expansion": { "version": "1.1.11", @@ -415,14 +150,30 @@ } }, "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", - "dev": true, + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "requires": { - "expand-range": "^1.8.1", - "preserve": "^0.2.0", - "repeat-element": "^1.1.2" + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } } }, "buffer-from": { @@ -450,13 +201,6 @@ "to-object-path": "^0.3.0", "union-value": "^1.0.0", "unset-value": "^1.0.0" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" - } } }, "camelcase": { @@ -517,94 +261,6 @@ "path-is-absolute": "^1.0.0", "readdirp": "^2.0.0", "upath": "^1.0.5" - }, - "dependencies": { - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" - }, - "is-glob": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", - "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "requires": { - "kind-of": "^3.0.2" - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" - } } }, "class-utils": { @@ -625,14 +281,14 @@ "requires": { "is-descriptor": "^0.1.0" } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" } } }, + "co": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/co/-/co-3.1.0.tgz", + "integrity": "sha1-TqVOpaCJOBUxheFSEMaNkJK8G3g=" + }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", @@ -748,16 +404,6 @@ "is-data-descriptor": "^1.0.0", "kind-of": "^6.0.2" } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" } } }, @@ -780,18 +426,41 @@ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" }, "estree-walker": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.5.1.tgz", - "integrity": "sha512-7HgCgz1axW7w5aOvgOQkoR1RMBkllygJrssU3BvymKQ95lxXYv6Pon17fBRDm9qhkvXZGijOULoSF9ShOk/ZLg==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.5.2.tgz", + "integrity": "sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig==", "dev": true }, "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "dev": true, + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "requires": { - "is-posix-bracket": "^0.1.0" + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } } }, "expand-range": { @@ -801,6 +470,48 @@ "dev": true, "requires": { "fill-range": "^2.1.0" + }, + "dependencies": { + "fill-range": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "dev": true, + "requires": { + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^3.0.0", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" + } + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } } }, "extend": { @@ -828,12 +539,62 @@ } }, "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "dev": true, + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", "requires": { - "is-extglob": "^1.0.0" + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } } }, "fault": { @@ -851,16 +612,24 @@ "dev": true }, "fill-range": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", - "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", - "dev": true, + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "requires": { - "is-number": "^2.1.0", - "isobject": "^2.0.0", - "randomatic": "^1.1.3", - "repeat-element": "^1.1.2", - "repeat-string": "^1.5.2" + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } } }, "fn-name": { @@ -1388,15 +1157,51 @@ "requires": { "glob-parent": "^2.0.0", "is-glob": "^2.0.0" + }, + "dependencies": { + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "^2.0.0" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + } } }, "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", "requires": { - "is-glob": "^2.0.0" + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "requires": { + "is-extglob": "^2.1.0" + } + } } }, "graceful-fs": { @@ -1417,13 +1222,6 @@ "get-value": "^2.0.6", "has-values": "^1.0.0", "isobject": "^3.0.0" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" - } } }, "has-values": { @@ -1435,24 +1233,6 @@ "kind-of": "^4.0.0" }, "dependencies": { - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "kind-of": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", @@ -1487,12 +1267,27 @@ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" }, + "irregular-plurals": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-2.0.0.tgz", + "integrity": "sha512-Y75zBYLkh0lJ9qxeHlMjQ7bSbyiSqNW/UOPWDmzC7cXskL1hekSITh1Oc6JV0XCWWZ9DE8VYSB71xocLk3gmGw==" + }, "is-accessor-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "requires": { "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } } }, "is-alphabetical": { @@ -1538,6 +1333,16 @@ "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "requires": { "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } } }, "is-decimal": { @@ -1588,10 +1393,9 @@ "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" }, "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" }, "is-fullwidth-code-point": { "version": "2.0.0", @@ -1599,12 +1403,11 @@ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" }, "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", + "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", "requires": { - "is-extglob": "^1.0.0" + "is-extglob": "^2.1.1" } }, "is-hexadecimal": { @@ -1624,12 +1427,21 @@ "dev": true }, "is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", - "dev": true, + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "requires": { "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } } }, "is-object": { @@ -1648,13 +1460,6 @@ "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "requires": { "isobject": "^3.0.1" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" - } } }, "is-posix-bracket": { @@ -1690,13 +1495,9 @@ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" }, "js-yaml": { "version": "3.12.0", @@ -1714,19 +1515,16 @@ }, "json5": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "resolved": "http://registry.npmjs.org/json5/-/json5-1.0.1.tgz", "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", "requires": { "minimist": "^1.2.0" } }, "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" }, "load-plugin": { "version": "2.2.2", @@ -1749,7 +1547,7 @@ }, "magic-string": { "version": "0.22.5", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", + "resolved": "http://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", "integrity": "sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w==", "dev": true, "requires": { @@ -1784,6 +1582,12 @@ "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-1.1.2.tgz", "integrity": "sha512-NcWuJFHDA8V3wkDgR/j4+gZx+YQwstPgfQDV8ndUeWWzta3dnDTBxpVzqS9lkmJAuV5YX35lmyojl6HO5JXAgw==" }, + "math-random": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", + "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", + "dev": true + }, "mdast-comment-marker": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/mdast-comment-marker/-/mdast-comment-marker-1.0.3.tgz", @@ -1797,25 +1601,34 @@ "unist-util-visit": "^1.1.0" } }, + "mdast-util-heading-style": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mdast-util-heading-style/-/mdast-util-heading-style-1.0.4.tgz", + "integrity": "sha512-n4fUvwpR5Uj1Ti658KxYDq9gR0UF3FK1UVTVig12imrSOssQU2OpUysje8nps5Cb85b6eau5akpWW7Zkxtv1XA==" + }, + "mdast-util-to-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.0.5.tgz", + "integrity": "sha512-2qLt/DEOo5F6nc2VFScQiHPzQ0XXcabquRJxKMhKte8nt42o08HUxNDPk7tt0YPxnWjAT11I1SYi0X0iPnfI5A==" + }, "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "dev": true, + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", "requires": { - "arr-diff": "^2.0.0", - "array-unique": "^0.2.1", - "braces": "^1.8.2", - "expand-brackets": "^0.1.4", - "extglob": "^0.3.1", - "filename-regex": "^2.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.1", - "kind-of": "^3.0.2", - "normalize-path": "^2.0.1", - "object.omit": "^2.0.0", - "parse-glob": "^3.0.4", - "regex-cache": "^0.4.2" + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" } }, "minimatch": { @@ -1856,9 +1669,9 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, "nan": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.0.tgz", - "integrity": "sha512-F4miItu2rGnV2ySkXOQoA8FKz/SR2Q2sWP0sbTxNxz/tuokeC8WxOhPMcwi0qIyGtVn/rrSeLbvVkznqCdwYnw==", + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz", + "integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==", "optional": true }, "nanomatch": { @@ -1877,23 +1690,6 @@ "regex-not": "^1.0.0", "snapdragon": "^0.8.1", "to-regex": "^3.0.1" - }, - "dependencies": { - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" - } } }, "normalize-path": { @@ -1936,6 +1732,14 @@ "requires": { "is-descriptor": "^0.1.0" } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } } } }, @@ -1945,13 +1749,6 @@ "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", "requires": { "isobject": "^3.0.0" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" - } } }, "object.omit": { @@ -1970,13 +1767,6 @@ "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", "requires": { "isobject": "^3.0.1" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" - } } }, "once": { @@ -1993,9 +1783,9 @@ "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" }, "parse-entities": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-1.1.2.tgz", - "integrity": "sha512-5N9lmQ7tmxfXf+hO3X6KRG6w7uYO/HL9fHalSySTdyn63C3WNvTM/1R8tn1u1larNcEbo3Slcy2bsVDQqvEpUg==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-1.2.0.tgz", + "integrity": "sha512-XXtDdOPLSB0sHecbEapQi6/58U/ODj/KWfIXmmMCJF/eRn8laX6LZbOyioMoETOOJoWRW8/qTSl5VQkUIfKM5g==", "requires": { "character-entities": "^1.0.0", "character-entities-legacy": "^1.0.0", @@ -2015,6 +1805,23 @@ "is-dotfile": "^1.0.0", "is-extglob": "^1.0.0", "is-glob": "^2.0.0" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + } } }, "parse-json": { @@ -2042,11 +1849,19 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-parse": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", - "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, + "plur": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/plur/-/plur-3.0.1.tgz", + "integrity": "sha512-lJl0ojUynAM1BZn58Pas2WT/TXeC1+bS+UqShl0x9+49AtOn7DixRXVzaC8qrDOIxNDmepKnLuMTH7NQmkX0PA==", + "requires": { + "irregular-plurals": "^2.0.0" + } + }, "posix-character-classes": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", @@ -2064,43 +1879,21 @@ "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" }, "randomatic": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.0.tgz", + "integrity": "sha512-KnGPVE0lo2WoXxIZ7cPR8YBpiol4gsSuOwDSg410oHh80ZMp5EiypNqL2K4Z77vJn6lB5rap7IkAmcUlalcnBQ==", "dev": true, "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" }, "dependencies": { "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "kind-of": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true } } }, @@ -2117,7 +1910,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "requires": { "core-util-is": "~1.0.0", @@ -2130,14 +1923,13 @@ } }, "readdirp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", - "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", "requires": { - "graceful-fs": "^4.1.2", - "minimatch": "^3.0.2", - "readable-stream": "^2.0.2", - "set-immediate-shim": "^1.0.1" + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" } }, "regex-cache": { @@ -2176,506 +1968,428 @@ "remark-message-control": "^4.0.0" } }, - "remark-message-control": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/remark-message-control/-/remark-message-control-4.1.0.tgz", - "integrity": "sha512-e1dszks4YKY7hLAkhS2367jBjBpAfvi+kVgSN/tOFrdp3qxITjiNR5fOFnyYF8vvorkQ9uxlKJoZUOW8T7rKDg==", + "remark-lint-blockquote-indentation": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-blockquote-indentation/-/remark-lint-blockquote-indentation-1.0.2.tgz", + "integrity": "sha512-u3ruA+4ZZOpt3YmTCdCOcYiGBMSQ/b/iJvZs/fibF6rwSBmkod48aGGJVoOLMuIuTYYbbXpzigxS+PeJwN0CDQ==", "requires": { - "mdast-comment-marker": "^1.0.0", - "unified-message-control": "^1.0.0", - "xtend": "^4.0.1" + "mdast-util-to-string": "^1.0.2", + "plur": "^3.0.0", + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-position": "^3.0.0", + "unist-util-visit": "^1.1.1" } }, - "remark-parse": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-4.0.0.tgz", - "integrity": "sha512-XZgICP2gJ1MHU7+vQaRM+VA9HEL3X253uwUM/BGgx3iv6TH2B3bF3B8q00DKcyP9YrJV+/7WOWEWBFF/u8cIsw==", + "remark-lint-checkbox-character-style": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-checkbox-character-style/-/remark-lint-checkbox-character-style-1.0.2.tgz", + "integrity": "sha512-8hTvHHGj0Ko5Qx9RjBVj9yPO/pOpSFzWVMvszyhZkuH/uy92bab/bmfUwl0/4f8gqsxqyRS/QC/Sp+KivWvYlw==", "requires": { - "collapse-white-space": "^1.0.2", - "is-alphabetical": "^1.0.0", - "is-decimal": "^1.0.0", - "is-whitespace-character": "^1.0.0", - "is-word-character": "^1.0.0", - "markdown-escapes": "^1.0.0", - "parse-entities": "^1.0.2", - "repeat-string": "^1.5.4", - "state-toggle": "^1.0.0", - "trim": "0.0.1", - "trim-trailing-lines": "^1.0.0", - "unherit": "^1.0.4", - "unist-util-remove-position": "^1.0.0", - "vfile-location": "^2.0.0", - "xtend": "^4.0.1" + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-position": "^3.0.0", + "unist-util-visit": "^1.1.1", + "vfile-location": "^2.0.1" } }, - "remark-preset-lint-node": { - "version": "file:remark-preset-lint-node", + "remark-lint-checkbox-content-indent": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-checkbox-content-indent/-/remark-lint-checkbox-content-indent-1.0.2.tgz", + "integrity": "sha512-9cPEpd3GpN5ZoAEBTl6qkVOIXpJSms+AC6L/gGLHOcfmSaR5jfgzQWE7GkCj6OvUqjV69zrGGHlWLu7uMujf3g==", "requires": { - "remark-lint": "^6.0.0", - "remark-lint-blockquote-indentation": "^1.0.0", - "remark-lint-checkbox-character-style": "^1.0.0", - "remark-lint-checkbox-content-indent": "^1.0.0", - "remark-lint-code-block-style": "^1.0.0", - "remark-lint-definition-spacing": "^1.0.0", - "remark-lint-fenced-code-flag": "^1.0.0", - "remark-lint-fenced-code-marker": "^1.0.0", - "remark-lint-file-extension": "^1.0.0", - "remark-lint-final-definition": "^1.0.0", - "remark-lint-final-newline": "^1.0.0", - "remark-lint-first-heading-level": "^1.0.0", - "remark-lint-hard-break-spaces": "^1.0.1", - "remark-lint-heading-style": "^1.0.0", - "remark-lint-maximum-line-length": "^1.0.2", - "remark-lint-no-auto-link-without-protocol": "^1.0.0", - "remark-lint-no-blockquote-without-caret": "^1.0.0", - "remark-lint-no-duplicate-definitions": "^1.0.0", - "remark-lint-no-file-name-articles": "^1.0.0", - "remark-lint-no-file-name-consecutive-dashes": "^1.0.0", - "remark-lint-no-file-name-outer-dashes": "^1.0.0", - "remark-lint-no-heading-content-indent": "^1.0.0", - "remark-lint-no-heading-indent": "^1.0.0", - "remark-lint-no-inline-padding": "^1.0.0", - "remark-lint-no-multiple-toplevel-headings": "^1.0.0", - "remark-lint-no-shell-dollars": "^1.0.0", - "remark-lint-no-shortcut-reference-image": "^1.0.0", - "remark-lint-no-table-indentation": "^1.0.0", - "remark-lint-no-tabs": "^1.0.0", - "remark-lint-no-unused-definitions": "^1.0.0", - "remark-lint-prohibited-strings": "^1.0.0", - "remark-lint-rule-style": "^1.0.0", - "remark-lint-strong-marker": "^1.0.0", - "remark-lint-table-cell-padding": "^1.0.0", - "remark-lint-table-pipes": "^1.0.0" - }, - "dependencies": { - "co": { - "version": "3.1.0", - "bundled": true - }, - "irregular-plurals": { - "version": "1.4.0", - "bundled": true - }, - "mdast-comment-marker": { - "version": "1.0.2", - "bundled": true - }, - "mdast-util-heading-style": { - "version": "1.0.3", - "bundled": true - }, - "mdast-util-to-string": { - "version": "1.0.4", - "bundled": true - }, - "plur": { - "version": "2.1.2", - "bundled": true, - "requires": { - "irregular-plurals": "^1.0.0" - } - }, - "remark-lint": { - "version": "6.0.1", - "bundled": true, - "requires": { - "remark-message-control": "^4.0.0" - } - }, - "remark-lint-blockquote-indentation": { - "version": "1.0.1", - "bundled": true, - "requires": { - "mdast-util-to-string": "^1.0.2", - "plur": "^2.1.2", - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-checkbox-character-style": { - "version": "1.0.1", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1", - "vfile-location": "^2.0.1" - } - }, - "remark-lint-checkbox-content-indent": { - "version": "1.0.1", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1", - "vfile-location": "^2.0.1" - } - }, - "remark-lint-code-block-style": { - "version": "1.0.1", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-definition-spacing": { - "version": "1.0.1", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-fenced-code-flag": { - "version": "1.0.1", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-fenced-code-marker": { - "version": "1.0.1", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-file-extension": { - "version": "1.0.1", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0" - } - }, - "remark-lint-final-definition": { - "version": "1.0.1", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-final-newline": { - "version": "1.0.1", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0" - } - }, - "remark-lint-first-heading-level": { - "version": "1.1.1", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-hard-break-spaces": { - "version": "1.0.2", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-heading-style": { - "version": "1.0.1", - "bundled": true, - "requires": { - "mdast-util-heading-style": "^1.0.2", - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-maximum-line-length": { - "version": "1.0.2", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-auto-link-without-protocol": { - "version": "1.0.1", - "bundled": true, - "requires": { - "mdast-util-to-string": "^1.0.2", - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-blockquote-without-caret": { - "version": "1.0.0", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1", - "vfile-location": "^2.0.1" - } - }, - "remark-lint-no-duplicate-definitions": { - "version": "1.0.1", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-file-name-articles": { - "version": "1.0.1", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0" - } - }, - "remark-lint-no-file-name-consecutive-dashes": { - "version": "1.0.1", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0" - } - }, - "remark-lint-no-file-name-outer-dashes": { - "version": "1.0.2", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0" - } - }, - "remark-lint-no-heading-content-indent": { - "version": "1.0.1", - "bundled": true, - "requires": { - "mdast-util-heading-style": "^1.0.2", - "plur": "^2.1.2", - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-heading-indent": { - "version": "1.0.1", - "bundled": true, - "requires": { - "plur": "^2.1.2", - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-inline-padding": { - "version": "1.0.1", - "bundled": true, - "requires": { - "mdast-util-to-string": "^1.0.2", - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-multiple-toplevel-headings": { - "version": "1.0.1", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-shell-dollars": { - "version": "1.0.1", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-shortcut-reference-image": { - "version": "1.0.1", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-table-indentation": { - "version": "1.0.1", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-tabs": { - "version": "1.0.1", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0", - "vfile-location": "^2.0.1" - } - }, - "remark-lint-no-unused-definitions": { - "version": "1.0.1", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-prohibited-strings": { - "version": "1.0.3", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.2", - "unist-util-visit": "^1.2.0" - } - }, - "remark-lint-rule-style": { - "version": "1.0.1", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-strong-marker": { - "version": "1.0.1", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-table-cell-padding": { - "version": "1.0.1", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-table-pipes": { - "version": "1.0.1", - "bundled": true, - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-message-control": { - "version": "4.1.0", - "bundled": true, - "requires": { - "mdast-comment-marker": "^1.0.0", - "unified-message-control": "^1.0.0", - "xtend": "^4.0.1" - } - }, - "sliced": { - "version": "1.0.1", - "bundled": true - }, - "trim": { - "version": "0.0.1", - "bundled": true - }, - "unified-lint-rule": { - "version": "1.0.2", - "bundled": true, - "requires": { - "wrapped": "^1.0.1" - } - }, - "unified-message-control": { - "version": "1.0.4", - "bundled": true, - "requires": { - "trim": "0.0.1", - "unist-util-visit": "^1.0.0", - "vfile-location": "^2.0.0" - } - }, - "unist-util-generated": { - "version": "1.1.2", - "bundled": true - }, - "unist-util-is": { - "version": "2.1.2", - "bundled": true - }, - "unist-util-position": { - "version": "3.0.1", - "bundled": true - }, - "unist-util-visit": { - "version": "1.3.1", - "bundled": true, - "requires": { - "unist-util-is": "^2.1.1" - } - }, - "vfile-location": { - "version": "2.0.3", - "bundled": true - }, - "wrapped": { - "version": "1.0.1", - "bundled": true, - "requires": { - "co": "3.1.0", - "sliced": "^1.0.1" - } - }, - "xtend": { - "version": "4.0.1", - "bundled": true - } + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-position": "^3.0.0", + "unist-util-visit": "^1.1.1", + "vfile-location": "^2.0.1" + } + }, + "remark-lint-code-block-style": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-code-block-style/-/remark-lint-code-block-style-1.0.2.tgz", + "integrity": "sha512-fTSCga/lJ710zBaD808NwqzAatVoLQFizvXWpetygKwoAfXCyMYQ9DUdDE5jdDhwOu2JPnKbxY+4t6m4SrKKWA==", + "requires": { + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-position": "^3.0.0", + "unist-util-visit": "^1.1.1" + } + }, + "remark-lint-definition-spacing": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-definition-spacing/-/remark-lint-definition-spacing-1.0.2.tgz", + "integrity": "sha512-Yg1BcI/nydXii1B6kiqKIBsqDW7KlOCBMpJO2jMGmNuEuZe8sv1AWNmaCtiSCdPuDiX0CZRidklrkrZwAthPdw==", + "requires": { + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-position": "^3.0.0", + "unist-util-visit": "^1.1.1" + } + }, + "remark-lint-fenced-code-flag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-fenced-code-flag/-/remark-lint-fenced-code-flag-1.0.2.tgz", + "integrity": "sha512-6/412zYtz+qKpFJryEPSMurWr6tO5MTVohJF3byFc3+3SSEZLWY3Dg8gbwFlumZ9T4HgmfUm/LT7Idm96zj0nw==", + "requires": { + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-position": "^3.0.0", + "unist-util-visit": "^1.1.1" + } + }, + "remark-lint-fenced-code-marker": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-fenced-code-marker/-/remark-lint-fenced-code-marker-1.0.2.tgz", + "integrity": "sha512-yAP59Q1JoI1jjOFCn0GoNx4uDji99ROLvdwvmz7+9YR9guDArBcR4i9Wem/wN6apauWPk2DbAZFavHvbZaT8HQ==", + "requires": { + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-position": "^3.0.0", + "unist-util-visit": "^1.1.1" + } + }, + "remark-lint-file-extension": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-file-extension/-/remark-lint-file-extension-1.0.2.tgz", + "integrity": "sha512-qx0uki74rmALIKE3r5J3neasbXnz6h+l88OngvpwWkELsnJmfk81JdxfEd0tZ++uTj6CN0TZuhMKad9smfNtRw==", + "requires": { + "unified-lint-rule": "^1.0.0" + } + }, + "remark-lint-final-definition": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-final-definition/-/remark-lint-final-definition-1.0.2.tgz", + "integrity": "sha512-F+n8eauYOJGdcSrnD7w2YgQSERx1rAwXTxStaJ2tLmoXlT7eQgpVGHz1U4Y76cg8OANbq8pT0KTNJ85JNqkq4g==", + "requires": { + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-position": "^3.0.0", + "unist-util-visit": "^1.1.1" + } + }, + "remark-lint-final-newline": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-final-newline/-/remark-lint-final-newline-1.0.2.tgz", + "integrity": "sha512-hW/lbDwVKtME3jIcJWJ16wBtoJdFPWIiu0fEI93yzNTjeB1g3VSWJp66dHbtCLYwquRS5fr8UlGx7JxIu1kiuA==", + "requires": { + "unified-lint-rule": "^1.0.0" + } + }, + "remark-lint-first-heading-level": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/remark-lint-first-heading-level/-/remark-lint-first-heading-level-1.1.2.tgz", + "integrity": "sha512-4LXZmaeQwlkOoK7PVGoI53ohwdaSB54MgQ+FZ353oVxRO1fY+nbNu70/qxvnyu8/23NK4GkCgHvDVb3+unRJNQ==", + "requires": { + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-visit": "^1.1.1" + } + }, + "remark-lint-hard-break-spaces": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/remark-lint-hard-break-spaces/-/remark-lint-hard-break-spaces-1.0.3.tgz", + "integrity": "sha512-GiC0uXeFwef6/Pfo+EYBN0WIVlEFffh+9TdeJ4uLt89ZweaRVDPCTJQqkkuXoiXSPnZGD7cGHdkWCfXU1PaU7Q==", + "requires": { + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-position": "^3.0.0", + "unist-util-visit": "^1.1.1" + } + }, + "remark-lint-heading-style": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-heading-style/-/remark-lint-heading-style-1.0.2.tgz", + "integrity": "sha512-d0aIbL8PU5LWfZVI8p49vEV5wWIfD/DdUjc+O8j5E0UWUgcRgPGB66xznkOb8AiniXpcaYggRW8hGZsxoYNt1g==", + "requires": { + "mdast-util-heading-style": "^1.0.2", + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-visit": "^1.1.1" + } + }, + "remark-lint-no-auto-link-without-protocol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-no-auto-link-without-protocol/-/remark-lint-no-auto-link-without-protocol-1.0.2.tgz", + "integrity": "sha512-3GtkSxOyd6we4b8JdtJsNgt8+3UN+hpw1UiMoE9X96ahc1rqsCFm6miorNUnF/gfPQ1liHBvZUed2SIenDmpkg==", + "requires": { + "mdast-util-to-string": "^1.0.2", + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-position": "^3.0.0", + "unist-util-visit": "^1.1.1" + } + }, + "remark-lint-no-blockquote-without-caret": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/remark-lint-no-blockquote-without-caret/-/remark-lint-no-blockquote-without-caret-1.0.0.tgz", + "integrity": "sha1-gd0i3V8EVOupwqU3u6Jgh0ShrW8=", + "requires": { + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-position": "^3.0.0", + "unist-util-visit": "^1.1.1", + "vfile-location": "^2.0.1" + } + }, + "remark-lint-no-duplicate-definitions": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-no-duplicate-definitions/-/remark-lint-no-duplicate-definitions-1.0.2.tgz", + "integrity": "sha512-e5tSoIBChG3UCz4eJ+JPKV915iNeIeT7uKBKzXBPxnMcEgQaT3V7DBDdN8Wn1oPw9fLp/5AjDN5l9x7iddLsRw==", + "requires": { + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-position": "^3.0.0", + "unist-util-stringify-position": "^1.1.2", + "unist-util-visit": "^1.1.1" + } + }, + "remark-lint-no-file-name-articles": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-articles/-/remark-lint-no-file-name-articles-1.0.2.tgz", + "integrity": "sha512-5FuxJ0Hd2AgVSP1javG51qPbMBWxma1LrCKI6JmBsu/GM7ZYOgemMyH5v4I1ejTPGj7P30xmIjMNSnV8IBMq3g==", + "requires": { + "unified-lint-rule": "^1.0.0" + } + }, + "remark-lint-no-file-name-consecutive-dashes": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-consecutive-dashes/-/remark-lint-no-file-name-consecutive-dashes-1.0.2.tgz", + "integrity": "sha512-VvCxG3AfRm6ROFNJ8+tdOOkk61mEKj+PytB8xg5WNQypKWhhJ734mJ3GzXD4XEov7Bdd1GVXJFXlLFtfoAewHw==", + "requires": { + "unified-lint-rule": "^1.0.0" + } + }, + "remark-lint-no-file-name-outer-dashes": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-outer-dashes/-/remark-lint-no-file-name-outer-dashes-1.0.3.tgz", + "integrity": "sha512-imUWm8Bi9PxV+IQtQC2/BV1Yj0VboC9hPMZh3sae8pZvCjXquTyYiSFa7hQxX6KWCNUiRPHMSlaSVvfvM2e4pQ==", + "requires": { + "unified-lint-rule": "^1.0.0" + } + }, + "remark-lint-no-heading-content-indent": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-no-heading-content-indent/-/remark-lint-no-heading-content-indent-1.0.2.tgz", + "integrity": "sha512-g2MVmJhHbfFungca5WGWVB9bBY4YTrY6og20U+6DxkdS4ngoc8ezXUt8zV1HHEn0M/GdKr9F7fYhXcekJd/qaw==", + "requires": { + "mdast-util-heading-style": "^1.0.2", + "plur": "^3.0.0", + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-position": "^3.0.0", + "unist-util-visit": "^1.1.1" + } + }, + "remark-lint-no-heading-indent": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-no-heading-indent/-/remark-lint-no-heading-indent-1.0.2.tgz", + "integrity": "sha512-BJ9mPGIFn6Pv0KN9Qwy27wQGllM6mPCv6VI6khDcURlzdAaX5hfFarGJVGKEgPWoL8zs8fPRoXMpsAHIonnnyA==", + "requires": { + "plur": "^3.0.0", + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-position": "^3.0.0", + "unist-util-visit": "^1.1.1" + } + }, + "remark-lint-no-inline-padding": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-no-inline-padding/-/remark-lint-no-inline-padding-1.0.2.tgz", + "integrity": "sha512-SHYqEH27yxzgcXSyaIzvqImvktDhXGltRSOEhAHiL2nJktuPt3nosFfGy4/oKAJMWJ2N3aMudXq/zuw1dAkQSg==", + "requires": { + "mdast-util-to-string": "^1.0.2", + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-visit": "^1.1.1" + } + }, + "remark-lint-no-multiple-toplevel-headings": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-no-multiple-toplevel-headings/-/remark-lint-no-multiple-toplevel-headings-1.0.2.tgz", + "integrity": "sha512-Zxkw7wIyMOyYQb5C5NTswSttZPCLqm/60Wnt0TEWzXVDkVk5DrxrCCxbMKgpXve1Co5CXPmMixNr/xYBqzxzWg==", + "requires": { + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-position": "^3.0.0", + "unist-util-stringify-position": "^1.1.2", + "unist-util-visit": "^1.1.1" + } + }, + "remark-lint-no-shell-dollars": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-no-shell-dollars/-/remark-lint-no-shell-dollars-1.0.2.tgz", + "integrity": "sha512-eIjBebX9iOFWbMdjol5JJBXI7ku+7UyJpNrd++rl8QenLLZ76beh+xONCzJw/k5dhEw5voBmQLh7VK9HPU/ang==", + "requires": { + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-visit": "^1.1.1" + } + }, + "remark-lint-no-shortcut-reference-image": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-no-shortcut-reference-image/-/remark-lint-no-shortcut-reference-image-1.0.2.tgz", + "integrity": "sha512-IVYv5pgyf70jYcrn+BNHVO37BuQJg26rFOLzi2mj+/8EdFpolJiJcTvkChJgz5yip7317DmQQSNLX6gCExuDrQ==", + "requires": { + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-visit": "^1.1.1" + } + }, + "remark-lint-no-table-indentation": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-no-table-indentation/-/remark-lint-no-table-indentation-1.0.2.tgz", + "integrity": "sha512-wH0lMGV3DGf7WeDLYGle7SODkXNKqmFtGuh6sG5oa0XgA17rI/L35Vq5tal4DE/5gQG+l4+/0Iy9FPKdBODSDA==", + "requires": { + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-position": "^3.0.0", + "unist-util-visit": "^1.1.1" + } + }, + "remark-lint-no-tabs": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-no-tabs/-/remark-lint-no-tabs-1.0.2.tgz", + "integrity": "sha512-jPjRLHyzO4lO6orhOmHd6AN6mVc/uMWvYZ3qD41dniktnLyHEbIG6DpPxixjfpmEe0wi73RXMywKHrWshLJwAg==", + "requires": { + "unified-lint-rule": "^1.0.0", + "vfile-location": "^2.0.1" + } + }, + "remark-lint-no-unused-definitions": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-no-unused-definitions/-/remark-lint-no-unused-definitions-1.0.2.tgz", + "integrity": "sha512-Qv4J2hI2S0NJdrlFuQhBVOlGNUSBLpe+2VBm/hSJAnBE7FW2ZGkVwwrs9h7HdZ/vW3LqfBrNcTKTVw+5ZzWTiA==", + "requires": { + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-visit": "^1.1.1" + } + }, + "remark-lint-prohibited-strings": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/remark-lint-prohibited-strings/-/remark-lint-prohibited-strings-1.0.3.tgz", + "integrity": "sha512-XgxDXQrNjnHd4+cGavdiW8y5ipN+DwJxWIZDUIWuWjEhmRmgUl8nJHXOKjIYZ8inYxuhVit9m1Y9kX12wO3Edw==", + "requires": { + "unified-lint-rule": "^1.0.2", + "unist-util-visit": "^1.2.0" + } + }, + "remark-lint-rule-style": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-rule-style/-/remark-lint-rule-style-1.0.2.tgz", + "integrity": "sha512-D9mMPKA7rtCe4Yx+ryip6FyfNG9uGOaHxRgJClfte7D66QzxiiWtHYyNCXI4rkv8Ax9PrEdpWCPcIl3D2LrXhw==", + "requires": { + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-position": "^3.0.0", + "unist-util-visit": "^1.1.1" + } + }, + "remark-lint-strong-marker": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-strong-marker/-/remark-lint-strong-marker-1.0.2.tgz", + "integrity": "sha512-oUSKqYJVLgbXe25NmcTOfQ8wsFasc+qhEoGjPEGPuJMV2aZIGuOEbGVqD5B1ckYGBEwbTuet3btvMohz8HaBDQ==", + "requires": { + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-position": "^3.0.0", + "unist-util-visit": "^1.1.1" + } + }, + "remark-lint-table-cell-padding": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-table-cell-padding/-/remark-lint-table-cell-padding-1.0.2.tgz", + "integrity": "sha512-uYm8ia0joAFeK0XLpxVtGW37Ry1XRBDmWH1gDiO2MXWcUip1w1Brvyue4H8JfXB4IM+S5eI/zPR5zN5Wpj9kfA==", + "requires": { + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-position": "^3.0.0", + "unist-util-visit": "^1.1.1" + } + }, + "remark-lint-table-pipes": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-table-pipes/-/remark-lint-table-pipes-1.0.2.tgz", + "integrity": "sha512-BGKcOviuUC6fILIOPYFe6awqk57ApzNJpK3OYBrweGoFF55nZ/qf3q6JpzA0chd6wKj7VrcfQEd3QSQQ+8Wcrw==", + "requires": { + "unified-lint-rule": "^1.0.0", + "unist-util-generated": "^1.1.0", + "unist-util-position": "^3.0.0", + "unist-util-visit": "^1.1.1" + } + }, + "remark-message-control": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/remark-message-control/-/remark-message-control-4.1.0.tgz", + "integrity": "sha512-e1dszks4YKY7hLAkhS2367jBjBpAfvi+kVgSN/tOFrdp3qxITjiNR5fOFnyYF8vvorkQ9uxlKJoZUOW8T7rKDg==", + "requires": { + "mdast-comment-marker": "^1.0.0", + "unified-message-control": "^1.0.0", + "xtend": "^4.0.1" + } + }, + "remark-parse": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-4.0.0.tgz", + "integrity": "sha512-XZgICP2gJ1MHU7+vQaRM+VA9HEL3X253uwUM/BGgx3iv6TH2B3bF3B8q00DKcyP9YrJV+/7WOWEWBFF/u8cIsw==", + "requires": { + "collapse-white-space": "^1.0.2", + "is-alphabetical": "^1.0.0", + "is-decimal": "^1.0.0", + "is-whitespace-character": "^1.0.0", + "is-word-character": "^1.0.0", + "markdown-escapes": "^1.0.0", + "parse-entities": "^1.0.2", + "repeat-string": "^1.5.4", + "state-toggle": "^1.0.0", + "trim": "0.0.1", + "trim-trailing-lines": "^1.0.0", + "unherit": "^1.0.4", + "unist-util-remove-position": "^1.0.0", + "vfile-location": "^2.0.0", + "xtend": "^4.0.1" + } + }, + "remark-preset-lint-node": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/remark-preset-lint-node/-/remark-preset-lint-node-1.0.3.tgz", + "integrity": "sha512-Ztmm7tcdWWmz/tpCU+bBz9QDRfjrTsa4PUSUWXwPBjQA07asGmw9qUzNTFc1iHXpXVs9xEz1IbVXpWwEJ+9uvA==", + "requires": { + "remark-lint": "^6.0.0", + "remark-lint-blockquote-indentation": "^1.0.0", + "remark-lint-checkbox-character-style": "^1.0.0", + "remark-lint-checkbox-content-indent": "^1.0.0", + "remark-lint-code-block-style": "^1.0.0", + "remark-lint-definition-spacing": "^1.0.0", + "remark-lint-fenced-code-flag": "^1.0.0", + "remark-lint-fenced-code-marker": "^1.0.0", + "remark-lint-file-extension": "^1.0.0", + "remark-lint-final-definition": "^1.0.0", + "remark-lint-final-newline": "^1.0.0", + "remark-lint-first-heading-level": "^1.0.0", + "remark-lint-hard-break-spaces": "^1.0.1", + "remark-lint-heading-style": "^1.0.0", + "remark-lint-no-auto-link-without-protocol": "^1.0.0", + "remark-lint-no-blockquote-without-caret": "^1.0.0", + "remark-lint-no-duplicate-definitions": "^1.0.0", + "remark-lint-no-file-name-articles": "^1.0.0", + "remark-lint-no-file-name-consecutive-dashes": "^1.0.0", + "remark-lint-no-file-name-outer-dashes": "^1.0.0", + "remark-lint-no-heading-content-indent": "^1.0.0", + "remark-lint-no-heading-indent": "^1.0.0", + "remark-lint-no-inline-padding": "^1.0.0", + "remark-lint-no-multiple-toplevel-headings": "^1.0.0", + "remark-lint-no-shell-dollars": "^1.0.0", + "remark-lint-no-shortcut-reference-image": "^1.0.0", + "remark-lint-no-table-indentation": "^1.0.0", + "remark-lint-no-tabs": "^1.0.0", + "remark-lint-no-unused-definitions": "^1.0.0", + "remark-lint-prohibited-strings": "^1.0.0", + "remark-lint-rule-style": "^1.0.0", + "remark-lint-strong-marker": "^1.0.0", + "remark-lint-table-cell-padding": "^1.0.0", + "remark-lint-table-pipes": "^1.0.0" } }, "remark-stringify": { @@ -2705,9 +2419,9 @@ "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" }, "repeat-element": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", - "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=" + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==" }, "repeat-string": { "version": "1.6.1", @@ -2720,9 +2434,9 @@ "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=" }, "resolve": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", - "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", + "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", "dev": true, "requires": { "path-parse": "^1.0.5" @@ -2745,13 +2459,13 @@ }, "rollup": { "version": "0.55.5", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-0.55.5.tgz", + "resolved": "http://registry.npmjs.org/rollup/-/rollup-0.55.5.tgz", "integrity": "sha512-2hke9NOy332kxvnmMQOgl7DHm94zihNyYJNd8ZLWo4U0EjFvjUkeWa0+ge+70bTg+mY0xJ7NUsf5kIhDtrGrtA==", "dev": true }, "rollup-plugin-commonjs": { "version": "8.4.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.4.1.tgz", + "resolved": "http://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.4.1.tgz", "integrity": "sha512-mg+WuD+jlwoo8bJtW3Mvx7Tz6TsIdMsdhuvCnDMoyjh0oxsVgsjB/N0X984RJCWwc5IIiqNVJhXeeITcc73++A==", "dev": true, "requires": { @@ -2783,20 +2497,103 @@ } }, "rollup-pluginutils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.0.1.tgz", - "integrity": "sha1-fslbNXP2VDpGpkYb2afFRFJdD8A=", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.3.3.tgz", + "integrity": "sha512-2XZwja7b6P5q4RZ5FhyX1+f46xi1Z3qBKigLRZ6VTZjwbN0K1IFGMlwm06Uu0Emcre2Z63l77nq/pzn+KxIEoA==", "dev": true, "requires": { - "estree-walker": "^0.3.0", + "estree-walker": "^0.5.2", "micromatch": "^2.3.11" }, "dependencies": { - "estree-walker": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.3.1.tgz", - "integrity": "sha1-5rGlHPcpJSTnI3wxLl/mZgwc4ao=", + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } } } }, @@ -2813,11 +2610,6 @@ "ret": "~0.1.10" } }, - "set-immediate-shim": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" - }, "set-value": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", @@ -2844,6 +2636,11 @@ "resolved": "https://registry.npmjs.org/shellsubstitute/-/shellsubstitute-1.2.0.tgz", "integrity": "sha1-5PcCpQxRiw9v6YRRiQ1wWvKba3A=" }, + "sliced": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", + "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" + }, "snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", @@ -2920,16 +2717,6 @@ "is-data-descriptor": "^1.0.0", "kind-of": "^6.0.2" } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" } } }, @@ -2939,6 +2726,16 @@ "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", "requires": { "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } } }, "source-map": { @@ -3060,6 +2857,16 @@ "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", "requires": { "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } } }, "to-regex": { @@ -3080,16 +2887,6 @@ "requires": { "is-number": "^3.0.0", "repeat-string": "^1.6.1" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "requires": { - "kind-of": "^3.0.2" - } - } } }, "to-vfile": { @@ -3177,13 +2974,18 @@ }, "dependencies": { "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.5.tgz", + "integrity": "sha512-D61LaDQPQkxJ5AUM2mbSJRbPkNs/TmdmOeLAi1hgDkpDfIfetSrjmWhccwtuResSwMbACjx/xXQofvM9CE/aeg==", "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + }, "unified-engine": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/unified-engine/-/unified-engine-6.0.1.tgz", @@ -3245,11 +3047,11 @@ "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" }, "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.5.tgz", + "integrity": "sha512-D61LaDQPQkxJ5AUM2mbSJRbPkNs/TmdmOeLAi1hgDkpDfIfetSrjmWhccwtuResSwMbACjx/xXQofvM9CE/aeg==", "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "has-flag": { @@ -3265,6 +3067,11 @@ "number-is-nan": "^1.0.0" } }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + }, "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", @@ -3277,7 +3084,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "requires": { "ansi-regex": "^2.0.0" @@ -3315,6 +3122,14 @@ } } }, + "unified-lint-rule": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.3.tgz", + "integrity": "sha512-6z+HH3mtlFdj/w3MaQpObrZAd9KRiro370GxBFh13qkV8LYR21lLozA4iQiZPhe7KuX/lHewoGOEgQ4AWrAR3Q==", + "requires": { + "wrapped": "^1.0.1" + } + }, "unified-message-control": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/unified-message-control/-/unified-message-control-1.0.4.tgz", @@ -3357,6 +3172,11 @@ } } }, + "unist-util-generated": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-1.1.2.tgz", + "integrity": "sha512-1HcwiEO62dr0XWGT+abVK4f0aAm8Ik8N08c5nAYVmuSxfvpA9rCcNyX/le8xXj1pJK5nBrGlZefeWB6bN8Pstw==" + }, "unist-util-inspect": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/unist-util-inspect/-/unist-util-inspect-4.1.3.tgz", @@ -3370,6 +3190,11 @@ "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-2.1.2.tgz", "integrity": "sha512-YkXBK/H9raAmG7KXck+UUpnKiNmUdB+aBGrknfQ4EreE1banuzrKABx3jP6Z5Z3fMSPMQQmeXBlKpCbMwBkxVw==" }, + "unist-util-position": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-3.0.1.tgz", + "integrity": "sha512-05QfJDPI7PE1BIUtAxeSV+cDx21xP7+tUZgSval5CA7tr0pHBwybF7OnEa1dOFqg6BfYH/qiMUnWwWj+Frhlww==" + }, "unist-util-remove-position": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-1.1.2.tgz", @@ -3432,11 +3257,6 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=" - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" } } }, @@ -3515,6 +3335,15 @@ "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==", "dev": true }, + "wrapped": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wrapped/-/wrapped-1.0.1.tgz", + "integrity": "sha1-x4PZ2Aeyc+mwHoUWgKk4yHyQckI=", + "requires": { + "co": "3.1.0", + "sliced": "^1.0.1" + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/tools/node-lint-md-cli-rollup/package.json b/tools/node-lint-md-cli-rollup/package.json index 881139057e1c5b..e2b105f91bcf4f 100644 --- a/tools/node-lint-md-cli-rollup/package.json +++ b/tools/node-lint-md-cli-rollup/package.json @@ -12,7 +12,7 @@ "markdown-extensions": "^1.1.0", "remark": "^8.0.0", "remark-lint": "^6.0.2", - "remark-preset-lint-node": "./remark-preset-lint-node", + "remark-preset-lint-node": "^1.0.3", "unified-args": "^6.0.0", "unified-engine": "^5.1.0" }, diff --git a/tools/node-lint-md-cli-rollup/remark-preset-lint-node/LICENSE b/tools/node-lint-md-cli-rollup/remark-preset-lint-node/LICENSE deleted file mode 100644 index 9cc180778cc2a2..00000000000000 --- a/tools/node-lint-md-cli-rollup/remark-preset-lint-node/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Daijiro Wachi - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/tools/node-lint-md-cli-rollup/remark-preset-lint-node/README.md b/tools/node-lint-md-cli-rollup/remark-preset-lint-node/README.md deleted file mode 100644 index d04e0b7e4225d0..00000000000000 --- a/tools/node-lint-md-cli-rollup/remark-preset-lint-node/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# remark-preset-lint-node -remark preset to configure remark-lint with settings for nodejs/node diff --git a/tools/node-lint-md-cli-rollup/remark-preset-lint-node/index.js b/tools/node-lint-md-cli-rollup/remark-preset-lint-node/index.js deleted file mode 100644 index d50b30f83dc57e..00000000000000 --- a/tools/node-lint-md-cli-rollup/remark-preset-lint-node/index.js +++ /dev/null @@ -1,54 +0,0 @@ -// @see https://github.com/nodejs/node/blob/master/doc/STYLE_GUIDE.md - -'use strict'; - -module.exports.plugins = [ - require('remark-lint'), - require('remark-lint-checkbox-content-indent'), - require('remark-lint-definition-spacing'), - require('remark-lint-fenced-code-flag'), - require('remark-lint-final-definition'), - require('remark-lint-final-newline'), - require('remark-lint-hard-break-spaces'), - require('remark-lint-no-auto-link-without-protocol'), - require('remark-lint-no-blockquote-without-caret'), - require('remark-lint-no-duplicate-definitions'), - require('remark-lint-no-file-name-articles'), - require('remark-lint-no-file-name-consecutive-dashes'), - require('remark-lint-no-file-name-outer-dashes'), - require('remark-lint-no-heading-content-indent'), - require('remark-lint-no-heading-indent'), - require('remark-lint-no-inline-padding'), - require('remark-lint-no-multiple-toplevel-headings'), - require('remark-lint-no-shell-dollars'), - require('remark-lint-no-shortcut-reference-image'), - require('remark-lint-no-table-indentation'), - require('remark-lint-no-tabs'), - require('remark-lint-no-unused-definitions'), - require('remark-lint-rule-style'), - require('remark-lint-table-pipes'), - [require('remark-lint-blockquote-indentation'), 2], - [ - require('remark-lint-checkbox-character-style'), - { - 'checked': 'x', 'unchecked': ' ' - } - ], - [require('remark-lint-code-block-style'), 'fenced'], - [require('remark-lint-fenced-code-marker'), '`'], - [require('remark-lint-file-extension'), 'md'], - [require('remark-lint-first-heading-level'), 1], - [require('remark-lint-heading-style'), 'atx'], - [ - require('remark-lint-prohibited-strings'), - [ - { no: 'Github', yes: 'GitHub' }, - { no: 'Javascript', yes: 'JavaScript' }, - { no: 'Node.JS', yes: 'Node.js' }, - { no: 'v8', yes: 'V8' } - ] - ], - [require('remark-lint-strong-marker'), '*'], - [require('remark-lint-table-cell-padding'), 'padded'], - [require('remark-lint-maximum-line-length'), 80] -]; diff --git a/tools/node-lint-md-cli-rollup/remark-preset-lint-node/package-lock.json b/tools/node-lint-md-cli-rollup/remark-preset-lint-node/package-lock.json deleted file mode 100644 index 568fb7f3cc7467..00000000000000 --- a/tools/node-lint-md-cli-rollup/remark-preset-lint-node/package-lock.json +++ /dev/null @@ -1,504 +0,0 @@ -{ - "name": "remark-preset-lint-node", - "version": "1.0.2", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "co": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/co/-/co-3.1.0.tgz", - "integrity": "sha1-TqVOpaCJOBUxheFSEMaNkJK8G3g=" - }, - "irregular-plurals": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-2.0.0.tgz", - "integrity": "sha512-Y75zBYLkh0lJ9qxeHlMjQ7bSbyiSqNW/UOPWDmzC7cXskL1hekSITh1Oc6JV0XCWWZ9DE8VYSB71xocLk3gmGw==" - }, - "mdast-comment-marker": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/mdast-comment-marker/-/mdast-comment-marker-1.0.3.tgz", - "integrity": "sha512-FZXxBBYeJ/R6k9zgyVGygHWka6FDJdzSbP6kcvB+L4Yqz62po57rZlnA2I14LIKsb3XPEky4vgP0Y83tZXTw7Q==" - }, - "mdast-util-heading-style": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mdast-util-heading-style/-/mdast-util-heading-style-1.0.4.tgz", - "integrity": "sha512-n4fUvwpR5Uj1Ti658KxYDq9gR0UF3FK1UVTVig12imrSOssQU2OpUysje8nps5Cb85b6eau5akpWW7Zkxtv1XA==" - }, - "mdast-util-to-string": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.0.5.tgz", - "integrity": "sha512-2qLt/DEOo5F6nc2VFScQiHPzQ0XXcabquRJxKMhKte8nt42o08HUxNDPk7tt0YPxnWjAT11I1SYi0X0iPnfI5A==" - }, - "plur": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/plur/-/plur-3.0.1.tgz", - "integrity": "sha512-lJl0ojUynAM1BZn58Pas2WT/TXeC1+bS+UqShl0x9+49AtOn7DixRXVzaC8qrDOIxNDmepKnLuMTH7NQmkX0PA==", - "requires": { - "irregular-plurals": "^2.0.0" - } - }, - "remark-lint": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/remark-lint/-/remark-lint-6.0.2.tgz", - "integrity": "sha512-zrIx7InZLLOUYUViT6lSa8T80pDyl3Ywvliog+4hoc7LoiJZRV74ejq+RBZK70bg/p2dU/CV6ycedgypFFePPg==", - "requires": { - "remark-message-control": "^4.0.0" - } - }, - "remark-lint-blockquote-indentation": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-blockquote-indentation/-/remark-lint-blockquote-indentation-1.0.2.tgz", - "integrity": "sha512-u3ruA+4ZZOpt3YmTCdCOcYiGBMSQ/b/iJvZs/fibF6rwSBmkod48aGGJVoOLMuIuTYYbbXpzigxS+PeJwN0CDQ==", - "requires": { - "mdast-util-to-string": "^1.0.2", - "plur": "^3.0.0", - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-checkbox-character-style": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-checkbox-character-style/-/remark-lint-checkbox-character-style-1.0.2.tgz", - "integrity": "sha512-8hTvHHGj0Ko5Qx9RjBVj9yPO/pOpSFzWVMvszyhZkuH/uy92bab/bmfUwl0/4f8gqsxqyRS/QC/Sp+KivWvYlw==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1", - "vfile-location": "^2.0.1" - } - }, - "remark-lint-checkbox-content-indent": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-checkbox-content-indent/-/remark-lint-checkbox-content-indent-1.0.2.tgz", - "integrity": "sha512-9cPEpd3GpN5ZoAEBTl6qkVOIXpJSms+AC6L/gGLHOcfmSaR5jfgzQWE7GkCj6OvUqjV69zrGGHlWLu7uMujf3g==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1", - "vfile-location": "^2.0.1" - } - }, - "remark-lint-code-block-style": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-code-block-style/-/remark-lint-code-block-style-1.0.2.tgz", - "integrity": "sha512-fTSCga/lJ710zBaD808NwqzAatVoLQFizvXWpetygKwoAfXCyMYQ9DUdDE5jdDhwOu2JPnKbxY+4t6m4SrKKWA==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-definition-spacing": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-definition-spacing/-/remark-lint-definition-spacing-1.0.2.tgz", - "integrity": "sha512-Yg1BcI/nydXii1B6kiqKIBsqDW7KlOCBMpJO2jMGmNuEuZe8sv1AWNmaCtiSCdPuDiX0CZRidklrkrZwAthPdw==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-fenced-code-flag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-fenced-code-flag/-/remark-lint-fenced-code-flag-1.0.2.tgz", - "integrity": "sha512-6/412zYtz+qKpFJryEPSMurWr6tO5MTVohJF3byFc3+3SSEZLWY3Dg8gbwFlumZ9T4HgmfUm/LT7Idm96zj0nw==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-fenced-code-marker": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-fenced-code-marker/-/remark-lint-fenced-code-marker-1.0.2.tgz", - "integrity": "sha512-yAP59Q1JoI1jjOFCn0GoNx4uDji99ROLvdwvmz7+9YR9guDArBcR4i9Wem/wN6apauWPk2DbAZFavHvbZaT8HQ==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-file-extension": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-file-extension/-/remark-lint-file-extension-1.0.2.tgz", - "integrity": "sha512-qx0uki74rmALIKE3r5J3neasbXnz6h+l88OngvpwWkELsnJmfk81JdxfEd0tZ++uTj6CN0TZuhMKad9smfNtRw==", - "requires": { - "unified-lint-rule": "^1.0.0" - } - }, - "remark-lint-final-definition": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-final-definition/-/remark-lint-final-definition-1.0.2.tgz", - "integrity": "sha512-F+n8eauYOJGdcSrnD7w2YgQSERx1rAwXTxStaJ2tLmoXlT7eQgpVGHz1U4Y76cg8OANbq8pT0KTNJ85JNqkq4g==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-final-newline": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-final-newline/-/remark-lint-final-newline-1.0.2.tgz", - "integrity": "sha512-hW/lbDwVKtME3jIcJWJ16wBtoJdFPWIiu0fEI93yzNTjeB1g3VSWJp66dHbtCLYwquRS5fr8UlGx7JxIu1kiuA==", - "requires": { - "unified-lint-rule": "^1.0.0" - } - }, - "remark-lint-first-heading-level": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/remark-lint-first-heading-level/-/remark-lint-first-heading-level-1.1.2.tgz", - "integrity": "sha512-4LXZmaeQwlkOoK7PVGoI53ohwdaSB54MgQ+FZ353oVxRO1fY+nbNu70/qxvnyu8/23NK4GkCgHvDVb3+unRJNQ==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-hard-break-spaces": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/remark-lint-hard-break-spaces/-/remark-lint-hard-break-spaces-1.0.3.tgz", - "integrity": "sha512-GiC0uXeFwef6/Pfo+EYBN0WIVlEFffh+9TdeJ4uLt89ZweaRVDPCTJQqkkuXoiXSPnZGD7cGHdkWCfXU1PaU7Q==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-heading-style": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-heading-style/-/remark-lint-heading-style-1.0.2.tgz", - "integrity": "sha512-d0aIbL8PU5LWfZVI8p49vEV5wWIfD/DdUjc+O8j5E0UWUgcRgPGB66xznkOb8AiniXpcaYggRW8hGZsxoYNt1g==", - "requires": { - "mdast-util-heading-style": "^1.0.2", - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-maximum-line-length": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remark-lint-maximum-line-length/-/remark-lint-maximum-line-length-1.1.0.tgz", - "integrity": "sha512-L+jI6+DReoxHyAWRIxABjX8hPDgxB8B5Lzp0/nDYjWbjl7I4vTsdEvejpmP1K8LVvZ7Ew0XcVHd1zt+p2O8tDg==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-auto-link-without-protocol": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-auto-link-without-protocol/-/remark-lint-no-auto-link-without-protocol-1.0.2.tgz", - "integrity": "sha512-3GtkSxOyd6we4b8JdtJsNgt8+3UN+hpw1UiMoE9X96ahc1rqsCFm6miorNUnF/gfPQ1liHBvZUed2SIenDmpkg==", - "requires": { - "mdast-util-to-string": "^1.0.2", - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-blockquote-without-caret": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-blockquote-without-caret/-/remark-lint-no-blockquote-without-caret-1.0.0.tgz", - "integrity": "sha1-gd0i3V8EVOupwqU3u6Jgh0ShrW8=", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1", - "vfile-location": "^2.0.1" - } - }, - "remark-lint-no-duplicate-definitions": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-duplicate-definitions/-/remark-lint-no-duplicate-definitions-1.0.2.tgz", - "integrity": "sha512-e5tSoIBChG3UCz4eJ+JPKV915iNeIeT7uKBKzXBPxnMcEgQaT3V7DBDdN8Wn1oPw9fLp/5AjDN5l9x7iddLsRw==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-stringify-position": "^1.1.2", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-file-name-articles": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-articles/-/remark-lint-no-file-name-articles-1.0.2.tgz", - "integrity": "sha512-5FuxJ0Hd2AgVSP1javG51qPbMBWxma1LrCKI6JmBsu/GM7ZYOgemMyH5v4I1ejTPGj7P30xmIjMNSnV8IBMq3g==", - "requires": { - "unified-lint-rule": "^1.0.0" - } - }, - "remark-lint-no-file-name-consecutive-dashes": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-consecutive-dashes/-/remark-lint-no-file-name-consecutive-dashes-1.0.2.tgz", - "integrity": "sha512-VvCxG3AfRm6ROFNJ8+tdOOkk61mEKj+PytB8xg5WNQypKWhhJ734mJ3GzXD4XEov7Bdd1GVXJFXlLFtfoAewHw==", - "requires": { - "unified-lint-rule": "^1.0.0" - } - }, - "remark-lint-no-file-name-outer-dashes": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-outer-dashes/-/remark-lint-no-file-name-outer-dashes-1.0.3.tgz", - "integrity": "sha512-imUWm8Bi9PxV+IQtQC2/BV1Yj0VboC9hPMZh3sae8pZvCjXquTyYiSFa7hQxX6KWCNUiRPHMSlaSVvfvM2e4pQ==", - "requires": { - "unified-lint-rule": "^1.0.0" - } - }, - "remark-lint-no-heading-content-indent": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-heading-content-indent/-/remark-lint-no-heading-content-indent-1.0.2.tgz", - "integrity": "sha512-g2MVmJhHbfFungca5WGWVB9bBY4YTrY6og20U+6DxkdS4ngoc8ezXUt8zV1HHEn0M/GdKr9F7fYhXcekJd/qaw==", - "requires": { - "mdast-util-heading-style": "^1.0.2", - "plur": "^3.0.0", - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-heading-indent": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-heading-indent/-/remark-lint-no-heading-indent-1.0.2.tgz", - "integrity": "sha512-BJ9mPGIFn6Pv0KN9Qwy27wQGllM6mPCv6VI6khDcURlzdAaX5hfFarGJVGKEgPWoL8zs8fPRoXMpsAHIonnnyA==", - "requires": { - "plur": "^3.0.0", - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-inline-padding": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-inline-padding/-/remark-lint-no-inline-padding-1.0.2.tgz", - "integrity": "sha512-SHYqEH27yxzgcXSyaIzvqImvktDhXGltRSOEhAHiL2nJktuPt3nosFfGy4/oKAJMWJ2N3aMudXq/zuw1dAkQSg==", - "requires": { - "mdast-util-to-string": "^1.0.2", - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-multiple-toplevel-headings": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-multiple-toplevel-headings/-/remark-lint-no-multiple-toplevel-headings-1.0.2.tgz", - "integrity": "sha512-Zxkw7wIyMOyYQb5C5NTswSttZPCLqm/60Wnt0TEWzXVDkVk5DrxrCCxbMKgpXve1Co5CXPmMixNr/xYBqzxzWg==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-stringify-position": "^1.1.2", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-shell-dollars": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-shell-dollars/-/remark-lint-no-shell-dollars-1.0.2.tgz", - "integrity": "sha512-eIjBebX9iOFWbMdjol5JJBXI7ku+7UyJpNrd++rl8QenLLZ76beh+xONCzJw/k5dhEw5voBmQLh7VK9HPU/ang==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-shortcut-reference-image": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-shortcut-reference-image/-/remark-lint-no-shortcut-reference-image-1.0.2.tgz", - "integrity": "sha512-IVYv5pgyf70jYcrn+BNHVO37BuQJg26rFOLzi2mj+/8EdFpolJiJcTvkChJgz5yip7317DmQQSNLX6gCExuDrQ==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-table-indentation": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-table-indentation/-/remark-lint-no-table-indentation-1.0.2.tgz", - "integrity": "sha512-wH0lMGV3DGf7WeDLYGle7SODkXNKqmFtGuh6sG5oa0XgA17rI/L35Vq5tal4DE/5gQG+l4+/0Iy9FPKdBODSDA==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-tabs": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-tabs/-/remark-lint-no-tabs-1.0.2.tgz", - "integrity": "sha512-jPjRLHyzO4lO6orhOmHd6AN6mVc/uMWvYZ3qD41dniktnLyHEbIG6DpPxixjfpmEe0wi73RXMywKHrWshLJwAg==", - "requires": { - "unified-lint-rule": "^1.0.0", - "vfile-location": "^2.0.1" - } - }, - "remark-lint-no-unused-definitions": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-unused-definitions/-/remark-lint-no-unused-definitions-1.0.2.tgz", - "integrity": "sha512-Qv4J2hI2S0NJdrlFuQhBVOlGNUSBLpe+2VBm/hSJAnBE7FW2ZGkVwwrs9h7HdZ/vW3LqfBrNcTKTVw+5ZzWTiA==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-prohibited-strings": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/remark-lint-prohibited-strings/-/remark-lint-prohibited-strings-1.0.3.tgz", - "integrity": "sha512-XgxDXQrNjnHd4+cGavdiW8y5ipN+DwJxWIZDUIWuWjEhmRmgUl8nJHXOKjIYZ8inYxuhVit9m1Y9kX12wO3Edw==", - "requires": { - "unified-lint-rule": "^1.0.2", - "unist-util-visit": "^1.2.0" - } - }, - "remark-lint-rule-style": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-rule-style/-/remark-lint-rule-style-1.0.2.tgz", - "integrity": "sha512-D9mMPKA7rtCe4Yx+ryip6FyfNG9uGOaHxRgJClfte7D66QzxiiWtHYyNCXI4rkv8Ax9PrEdpWCPcIl3D2LrXhw==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-strong-marker": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-strong-marker/-/remark-lint-strong-marker-1.0.2.tgz", - "integrity": "sha512-oUSKqYJVLgbXe25NmcTOfQ8wsFasc+qhEoGjPEGPuJMV2aZIGuOEbGVqD5B1ckYGBEwbTuet3btvMohz8HaBDQ==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-table-cell-padding": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-table-cell-padding/-/remark-lint-table-cell-padding-1.0.2.tgz", - "integrity": "sha512-uYm8ia0joAFeK0XLpxVtGW37Ry1XRBDmWH1gDiO2MXWcUip1w1Brvyue4H8JfXB4IM+S5eI/zPR5zN5Wpj9kfA==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-table-pipes": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-table-pipes/-/remark-lint-table-pipes-1.0.2.tgz", - "integrity": "sha512-BGKcOviuUC6fILIOPYFe6awqk57ApzNJpK3OYBrweGoFF55nZ/qf3q6JpzA0chd6wKj7VrcfQEd3QSQQ+8Wcrw==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-message-control": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/remark-message-control/-/remark-message-control-4.1.0.tgz", - "integrity": "sha512-e1dszks4YKY7hLAkhS2367jBjBpAfvi+kVgSN/tOFrdp3qxITjiNR5fOFnyYF8vvorkQ9uxlKJoZUOW8T7rKDg==", - "requires": { - "mdast-comment-marker": "^1.0.0", - "unified-message-control": "^1.0.0", - "xtend": "^4.0.1" - } - }, - "sliced": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", - "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" - }, - "trim": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", - "integrity": "sha1-WFhUf2spB1fulczMZm+1AITEYN0=" - }, - "unified-lint-rule": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.3.tgz", - "integrity": "sha512-6z+HH3mtlFdj/w3MaQpObrZAd9KRiro370GxBFh13qkV8LYR21lLozA4iQiZPhe7KuX/lHewoGOEgQ4AWrAR3Q==", - "requires": { - "wrapped": "^1.0.1" - } - }, - "unified-message-control": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unified-message-control/-/unified-message-control-1.0.4.tgz", - "integrity": "sha512-e1dEtN4Z/TvLn/qHm+xeZpzqhJTtfZusFErk336kkZVpqrJYiV9ptxq+SbRPFMlN0OkjDYHmVJ929KYjsMTo3g==", - "requires": { - "trim": "0.0.1", - "unist-util-visit": "^1.0.0", - "vfile-location": "^2.0.0" - } - }, - "unist-util-generated": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-1.1.2.tgz", - "integrity": "sha512-1HcwiEO62dr0XWGT+abVK4f0aAm8Ik8N08c5nAYVmuSxfvpA9rCcNyX/le8xXj1pJK5nBrGlZefeWB6bN8Pstw==" - }, - "unist-util-is": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-2.1.2.tgz", - "integrity": "sha512-YkXBK/H9raAmG7KXck+UUpnKiNmUdB+aBGrknfQ4EreE1banuzrKABx3jP6Z5Z3fMSPMQQmeXBlKpCbMwBkxVw==" - }, - "unist-util-position": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-3.0.1.tgz", - "integrity": "sha512-05QfJDPI7PE1BIUtAxeSV+cDx21xP7+tUZgSval5CA7tr0pHBwybF7OnEa1dOFqg6BfYH/qiMUnWwWj+Frhlww==" - }, - "unist-util-stringify-position": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-1.1.2.tgz", - "integrity": "sha512-pNCVrk64LZv1kElr0N1wPiHEUoXNVFERp+mlTg/s9R5Lwg87f9bM/3sQB99w+N9D/qnM9ar3+AKDBwo/gm/iQQ==" - }, - "unist-util-visit": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.0.tgz", - "integrity": "sha512-FiGu34ziNsZA3ZUteZxSFaczIjGmksfSgdKqBfOejrrfzyUy5b7YrlzT1Bcvi+djkYDituJDy2XB7tGTeBieKw==", - "requires": { - "unist-util-visit-parents": "^2.0.0" - } - }, - "unist-util-visit-parents": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.0.1.tgz", - "integrity": "sha512-6B0UTiMfdWql4cQ03gDTCSns+64Zkfo2OCbK31Ov0uMizEz+CJeAp0cgZVb5Fhmcd7Bct2iRNywejT0orpbqUA==", - "requires": { - "unist-util-is": "^2.1.2" - } - }, - "vfile-location": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-2.0.3.tgz", - "integrity": "sha512-zM5/l4lfw1CBoPx3Jimxoc5RNDAHHpk6AM6LM0pTIkm5SUSsx8ZekZ0PVdf0WEZ7kjlhSt7ZlqbRL6Cd6dBs6A==" - }, - "wrapped": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wrapped/-/wrapped-1.0.1.tgz", - "integrity": "sha1-x4PZ2Aeyc+mwHoUWgKk4yHyQckI=", - "requires": { - "co": "3.1.0", - "sliced": "^1.0.1" - } - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" - } - } -} diff --git a/tools/node-lint-md-cli-rollup/remark-preset-lint-node/package.json b/tools/node-lint-md-cli-rollup/remark-preset-lint-node/package.json deleted file mode 100644 index 285ba74d5f88bb..00000000000000 --- a/tools/node-lint-md-cli-rollup/remark-preset-lint-node/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "remark-preset-lint-node", - "version": "1.0.2", - "description": "remark preset to configure remark-lint with settings for nodejs/node", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/watilde/remark-preset-lint-node.git" - }, - "keywords": [], - "author": "", - "license": "MIT", - "bugs": { - "url": "https://github.com/watilde/remark-preset-lint-node/issues" - }, - "homepage": "https://github.com/watilde/remark-preset-lint-node#readme", - "dependencies": { - "remark-lint": "^6.0.0", - "remark-lint-blockquote-indentation": "^1.0.0", - "remark-lint-checkbox-character-style": "^1.0.0", - "remark-lint-checkbox-content-indent": "^1.0.0", - "remark-lint-code-block-style": "^1.0.0", - "remark-lint-definition-spacing": "^1.0.0", - "remark-lint-fenced-code-flag": "^1.0.0", - "remark-lint-fenced-code-marker": "^1.0.0", - "remark-lint-file-extension": "^1.0.0", - "remark-lint-final-definition": "^1.0.0", - "remark-lint-final-newline": "^1.0.0", - "remark-lint-first-heading-level": "^1.0.0", - "remark-lint-hard-break-spaces": "^1.0.1", - "remark-lint-heading-style": "^1.0.0", - "remark-lint-maximum-line-length": "^1.0.2", - "remark-lint-no-auto-link-without-protocol": "^1.0.0", - "remark-lint-no-blockquote-without-caret": "^1.0.0", - "remark-lint-no-duplicate-definitions": "^1.0.0", - "remark-lint-no-file-name-articles": "^1.0.0", - "remark-lint-no-file-name-consecutive-dashes": "^1.0.0", - "remark-lint-no-file-name-outer-dashes": "^1.0.0", - "remark-lint-no-heading-content-indent": "^1.0.0", - "remark-lint-no-heading-indent": "^1.0.0", - "remark-lint-no-inline-padding": "^1.0.0", - "remark-lint-no-multiple-toplevel-headings": "^1.0.0", - "remark-lint-no-shell-dollars": "^1.0.0", - "remark-lint-no-shortcut-reference-image": "^1.0.0", - "remark-lint-no-table-indentation": "^1.0.0", - "remark-lint-no-tabs": "^1.0.0", - "remark-lint-no-unused-definitions": "^1.0.0", - "remark-lint-prohibited-strings": "^1.0.0", - "remark-lint-rule-style": "^1.0.0", - "remark-lint-strong-marker": "^1.0.0", - "remark-lint-table-cell-padding": "^1.0.0", - "remark-lint-table-pipes": "^1.0.0" - } -} diff --git a/tools/node_modules/eslint/lib/linter.js b/tools/node_modules/eslint/lib/linter.js index 8f7bdf9e4c79c3..b47e6eb1fcfb6a 100644 --- a/tools/node_modules/eslint/lib/linter.js +++ b/tools/node_modules/eslint/lib/linter.js @@ -888,6 +888,15 @@ module.exports = class Linter { this.environments = new Environments(); } + /** + * Getter for package version. + * @static + * @returns {string} The version from package.json. + */ + static get version() { + return pkg.version; + } + /** * Configuration object for the `verify` API. A JS representation of the eslintrc files. * @typedef {Object} ESLintConfig diff --git a/tools/node_modules/eslint/lib/rules/camelcase.js b/tools/node_modules/eslint/lib/rules/camelcase.js index 3005963ab04c2d..41040450f94294 100644 --- a/tools/node_modules/eslint/lib/rules/camelcase.js +++ b/tools/node_modules/eslint/lib/rules/camelcase.js @@ -27,6 +27,16 @@ module.exports = { }, properties: { enum: ["always", "never"] + }, + allow: { + type: "array", + items: [ + { + type: "string" + } + ], + minItems: 0, + uniqueItems: true } }, additionalProperties: false @@ -40,6 +50,15 @@ module.exports = { create(context) { + const options = context.options[0] || {}; + let properties = options.properties || ""; + const ignoreDestructuring = options.ignoreDestructuring || false; + const allow = options.allow || []; + + if (properties !== "always" && properties !== "never") { + properties = "always"; + } + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -60,6 +79,18 @@ module.exports = { return name.indexOf("_") > -1 && name !== name.toUpperCase(); } + /** + * Checks if a string match the ignore list + * @param {string} name The string to check. + * @returns {boolean} if the string is ignored + * @private + */ + function isAllowed(name) { + return allow.findIndex( + entry => name === entry || name.match(new RegExp(entry)) + ) !== -1; + } + /** * Checks if a parent of a node is an ObjectPattern. * @param {ASTNode} node The node to check. @@ -93,14 +124,6 @@ module.exports = { } } - const options = context.options[0] || {}; - let properties = options.properties || ""; - const ignoreDestructuring = options.ignoreDestructuring || false; - - if (properties !== "always" && properties !== "never") { - properties = "always"; - } - return { Identifier(node) { @@ -112,6 +135,11 @@ module.exports = { const name = node.name.replace(/^_+|_+$/g, ""), effectiveParent = (node.parent.type === "MemberExpression") ? node.parent.parent : node.parent; + // First, we ignore the node if it match the ignore list + if (isAllowed(name)) { + return; + } + // MemberExpressions get special rules if (node.parent.type === "MemberExpression") { diff --git a/tools/node_modules/eslint/lib/rules/no-extra-bind.js b/tools/node_modules/eslint/lib/rules/no-extra-bind.js index b8376adfc11779..6d6cad13e97deb 100644 --- a/tools/node_modules/eslint/lib/rules/no-extra-bind.js +++ b/tools/node_modules/eslint/lib/rules/no-extra-bind.js @@ -10,6 +10,12 @@ const astUtils = require("../util/ast-utils"); +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SIDE_EFFECT_FREE_NODE_TYPES = new Set(["Literal", "Identifier", "ThisExpression", "FunctionExpression"]); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ @@ -35,6 +41,18 @@ module.exports = { create(context) { let scopeInfo = null; + /** + * Checks if a node is free of side effects. + * + * This check is stricter than it needs to be, in order to keep the implementation simple. + * + * @param {ASTNode} node A node to check. + * @returns {boolean} True if the node is known to be side-effect free, false otherwise. + */ + function isSideEffectFree(node) { + return SIDE_EFFECT_FREE_NODE_TYPES.has(node.type); + } + /** * Reports a given function node. * @@ -48,6 +66,10 @@ module.exports = { messageId: "unexpected", loc: node.parent.property.loc.start, fix(fixer) { + if (node.parent.parent.arguments.length && !isSideEffectFree(node.parent.parent.arguments[0])) { + return null; + } + const firstTokenToRemove = context.getSourceCode() .getFirstTokenBetween(node.parent.object, node.parent.property, astUtils.isNotClosingParenToken); 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 729f829a1f71ea..de6934c635ac33 100644 --- a/tools/node_modules/eslint/lib/rules/no-irregular-whitespace.js +++ b/tools/node_modules/eslint/lib/rules/no-irregular-whitespace.js @@ -81,9 +81,7 @@ module.exports = { const locStart = node.loc.start; const locEnd = node.loc.end; - errors = errors.filter(error => { - const errorLoc = error[1]; - + errors = errors.filter(({ loc: errorLoc }) => { if (errorLoc.line >= locStart.line && errorLoc.line <= locEnd.line) { if (errorLoc.column >= locStart.column && (errorLoc.column <= locEnd.column || errorLoc.line < locEnd.line)) { return false; @@ -157,7 +155,7 @@ module.exports = { column: match.index }; - errors.push([node, location, "Irregular whitespace not allowed."]); + errors.push({ node, message: "Irregular whitespace not allowed.", loc: location }); } }); } @@ -182,7 +180,7 @@ module.exports = { column: sourceLines[lineIndex].length }; - errors.push([node, location, "Irregular whitespace not allowed."]); + errors.push({ node, message: "Irregular whitespace not allowed.", loc: location }); lastLineIndex = lineIndex; } } @@ -224,9 +222,7 @@ module.exports = { } // If we have any errors remaining report on them - errors.forEach(error => { - context.report(...error); - }); + errors.forEach(error => context.report(error)); }; } else { nodes.Program = noop; diff --git a/tools/node_modules/eslint/lib/rules/no-tabs.js b/tools/node_modules/eslint/lib/rules/no-tabs.js index 08a8fa5b758b4f..c22a94da38bee1 100644 --- a/tools/node_modules/eslint/lib/rules/no-tabs.js +++ b/tools/node_modules/eslint/lib/rules/no-tabs.js @@ -8,7 +8,9 @@ //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ -const regex = /\t/; + +const tabRegex = /\t+/g; +const anyNonWhitespaceRegex = /\S/; //------------------------------------------------------------------------------ // Public Interface @@ -22,21 +24,36 @@ module.exports = { recommended: false, url: "https://eslint.org/docs/rules/no-tabs" }, - schema: [] + schema: [{ + type: "object", + properties: { + allowIndentationTabs: { + type: "boolean" + } + }, + additionalProperties: false + }] }, create(context) { + const sourceCode = context.getSourceCode(); + const allowIndentationTabs = context.options && context.options[0] && context.options[0].allowIndentationTabs; + return { Program(node) { - context.getSourceCode().getLines().forEach((line, index) => { - const match = regex.exec(line); + sourceCode.getLines().forEach((line, index) => { + let match; + + while ((match = tabRegex.exec(line)) !== null) { + if (allowIndentationTabs && !anyNonWhitespaceRegex.test(line.slice(0, match.index))) { + continue; + } - if (match) { context.report({ node, loc: { line: index + 1, - column: match.index + 1 + column: match.index }, message: "Unexpected tab character." }); 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 fff3e33d92355f..6f36813aca57a5 100644 --- a/tools/node_modules/eslint/lib/rules/no-unused-vars.js +++ b/tools/node_modules/eslint/lib/rules/no-unused-vars.js @@ -469,7 +469,7 @@ module.exports = { const posteriorParams = params.slice(params.indexOf(variable) + 1); // If any used parameters occur after this parameter, do not report. - return !posteriorParams.some(v => v.references.length > 0); + return !posteriorParams.some(v => v.references.length > 0 || v.eslintUsed); } /** diff --git a/tools/node_modules/eslint/lib/rules/one-var.js b/tools/node_modules/eslint/lib/rules/one-var.js index 15b664d77a3ce9..3efd0f27f7f301 100644 --- a/tools/node_modules/eslint/lib/rules/one-var.js +++ b/tools/node_modules/eslint/lib/rules/one-var.js @@ -314,6 +314,11 @@ module.exports = { function splitDeclarations(declaration) { return fixer => declaration.declarations.map(declarator => { const tokenAfterDeclarator = sourceCode.getTokenAfter(declarator); + + if (tokenAfterDeclarator === null) { + return null; + } + const afterComma = sourceCode.getTokenAfter(tokenAfterDeclarator, { includeComments: true }); if (tokenAfterDeclarator.value !== ",") { diff --git a/tools/node_modules/eslint/lib/rules/padding-line-between-statements.js b/tools/node_modules/eslint/lib/rules/padding-line-between-statements.js index f571e1e2e33500..4af85fef015aad 100644 --- a/tools/node_modules/eslint/lib/rules/padding-line-between-statements.js +++ b/tools/node_modules/eslint/lib/rules/padding-line-between-statements.js @@ -353,6 +353,9 @@ const StatementTypes = { node.type === "ExpressionStatement" && !isDirectivePrologue(node, sourceCode) }, + iife: { + test: isIIFEStatement + }, "multiline-block-like": { test: (node, sourceCode) => node.loc.start.line !== node.loc.end.line && diff --git a/tools/node_modules/eslint/lib/rules/prefer-const.js b/tools/node_modules/eslint/lib/rules/prefer-const.js index 774fcf06437626..8b3bc5e0e436d3 100644 --- a/tools/node_modules/eslint/lib/rules/prefer-const.js +++ b/tools/node_modules/eslint/lib/rules/prefer-const.js @@ -57,6 +57,7 @@ function canBecomeVariableDeclaration(identifier) { * @returns {boolean} Indicates if the variable is from outer scope or function parameters. */ function isOuterVariableInDestructing(name, initScope) { + if (initScope.through.find(ref => ref.resolved && ref.resolved.name === name)) { return true; } @@ -96,6 +97,54 @@ function getDestructuringHost(reference) { return node; } +/** + * Determines if a destructuring assignment node contains + * any MemberExpression nodes. This is used to determine if a + * variable that is only written once using destructuring can be + * safely converted into a const declaration. + * @param {ASTNode} node The ObjectPattern or ArrayPattern node to check. + * @returns {boolean} True if the destructuring pattern contains + * a MemberExpression, false if not. + */ +function hasMemberExpressionAssignment(node) { + switch (node.type) { + case "ObjectPattern": + return node.properties.some(prop => { + if (prop) { + + /* + * Spread elements have an argument property while + * others have a value property. Because different + * parsers use different node types for spread elements, + * we just check if there is an argument property. + */ + return hasMemberExpressionAssignment(prop.argument || prop.value); + } + + return false; + }); + + case "ArrayPattern": + return node.elements.some(element => { + if (element) { + return hasMemberExpressionAssignment(element); + } + + return false; + }); + + case "AssignmentPattern": + return hasMemberExpressionAssignment(node.left); + + case "MemberExpression": + return true; + + // no default + } + + return false; +} + /** * Gets an identifier node of a given variable. * @@ -148,7 +197,8 @@ function getIdentifierIfShouldBeConst(variable, ignoreReadBeforeAssign) { if (destructuringHost !== null && destructuringHost.left !== void 0) { const leftNode = destructuringHost.left; - let hasOuterVariables = false; + let hasOuterVariables = false, + hasNonIdentifiers = false; if (leftNode.type === "ObjectPattern") { const properties = leftNode.properties; @@ -157,16 +207,23 @@ function getIdentifierIfShouldBeConst(variable, ignoreReadBeforeAssign) { .filter(prop => prop.value) .map(prop => prop.value.name) .some(name => isOuterVariableInDestructing(name, variable.scope)); + + hasNonIdentifiers = hasMemberExpressionAssignment(leftNode); + } else if (leftNode.type === "ArrayPattern") { const elements = leftNode.elements; hasOuterVariables = elements .map(element => element && element.name) .some(name => isOuterVariableInDestructing(name, variable.scope)); + + hasNonIdentifiers = hasMemberExpressionAssignment(leftNode); } - if (hasOuterVariables) { + + if (hasOuterVariables || hasNonIdentifiers) { return null; } + } writer = reference; @@ -192,9 +249,11 @@ function getIdentifierIfShouldBeConst(variable, ignoreReadBeforeAssign) { if (!shouldBeConst) { return null; } + if (isReadBeforeInit) { return variable.defs[0].name; } + return writer.identifier; } @@ -295,7 +354,7 @@ module.exports = { create(context) { const options = context.options[0] || {}; const sourceCode = context.getSourceCode(); - const checkingMixedDestructuring = options.destructuring !== "all"; + const shouldMatchAnyDestructuredVariable = options.destructuring !== "all"; const ignoreReadBeforeAssign = options.ignoreReadBeforeAssign === true; const variables = []; @@ -316,7 +375,7 @@ module.exports = { function checkGroup(nodes) { const nodesToReport = nodes.filter(Boolean); - if (nodes.length && (checkingMixedDestructuring || nodesToReport.length === nodes.length)) { + if (nodes.length && (shouldMatchAnyDestructuredVariable || nodesToReport.length === nodes.length)) { const varDeclParent = findUp(nodes[0], "VariableDeclaration", parentNode => parentNode.type.endsWith("Statement")); const shouldFix = varDeclParent && 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 49b64658d190e0..17b49cc1184ca1 100644 --- a/tools/node_modules/eslint/lib/rules/space-infix-ops.js +++ b/tools/node_modules/eslint/lib/rules/space-infix-ops.js @@ -34,37 +34,25 @@ module.exports = { create(context) { const int32Hint = context.options[0] ? context.options[0].int32Hint === true : false; - - const OPERATORS = [ - "*", "/", "%", "+", "-", "<<", ">>", ">>>", "<", "<=", ">", ">=", "in", - "instanceof", "==", "!=", "===", "!==", "&", "^", "|", "&&", "||", "=", - "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", "&=", "^=", "|=", - "?", ":", ",", "**" - ]; - const sourceCode = context.getSourceCode(); /** * Returns the first token which violates the rule * @param {ASTNode} left - The left node of the main node * @param {ASTNode} right - The right node of the main node + * @param {string} op - The operator of the main node * @returns {Object} The violator token or null * @private */ - function getFirstNonSpacedToken(left, right) { - const tokens = sourceCode.getTokensBetween(left, right, 1); - - for (let i = 1, l = tokens.length - 1; i < l; ++i) { - const op = tokens[i]; - - if ( - (op.type === "Punctuator" || op.type === "Keyword") && - OPERATORS.indexOf(op.value) >= 0 && - (tokens[i - 1].range[1] >= op.range[0] || op.range[1] >= tokens[i + 1].range[0]) - ) { - return op; - } + function getFirstNonSpacedToken(left, right, op) { + const operator = sourceCode.getFirstTokenBetween(left, right, token => token.value === op); + const prev = sourceCode.getTokenBefore(operator); + const next = sourceCode.getTokenAfter(operator); + + if (!sourceCode.isSpaceBetweenTokens(prev, operator) || !sourceCode.isSpaceBetweenTokens(operator, next)) { + return operator; } + return null; } @@ -110,7 +98,10 @@ module.exports = { const leftNode = (node.left.typeAnnotation) ? node.left.typeAnnotation : node.left; const rightNode = node.right; - const nonSpacedNode = getFirstNonSpacedToken(leftNode, rightNode); + // search for = in AssignmentPattern nodes + const operator = node.operator || "="; + + const nonSpacedNode = getFirstNonSpacedToken(leftNode, rightNode, operator); if (nonSpacedNode) { if (!(int32Hint && sourceCode.getText(node).endsWith("|0"))) { @@ -126,8 +117,8 @@ module.exports = { * @private */ function checkConditional(node) { - const nonSpacedConsequesntNode = getFirstNonSpacedToken(node.test, node.consequent); - const nonSpacedAlternateNode = getFirstNonSpacedToken(node.consequent, node.alternate); + const nonSpacedConsequesntNode = getFirstNonSpacedToken(node.test, node.consequent, "?"); + const nonSpacedAlternateNode = getFirstNonSpacedToken(node.consequent, node.alternate, ":"); if (nonSpacedConsequesntNode) { report(node, nonSpacedConsequesntNode); @@ -147,7 +138,7 @@ module.exports = { const rightNode = node.init; if (rightNode) { - const nonSpacedNode = getFirstNonSpacedToken(leftNode, rightNode); + const nonSpacedNode = getFirstNonSpacedToken(leftNode, rightNode, "="); if (nonSpacedNode) { report(node, nonSpacedNode); diff --git a/tools/node_modules/eslint/lib/testers/rule-tester.js b/tools/node_modules/eslint/lib/testers/rule-tester.js index 9fbca945b62ee4..6d1bba989fdeea 100644 --- a/tools/node_modules/eslint/lib/testers/rule-tester.js +++ b/tools/node_modules/eslint/lib/testers/rule-tester.js @@ -397,7 +397,7 @@ class RuleTester { */ function assertASTDidntChange(beforeAST, afterAST) { if (!lodash.isEqual(beforeAST, afterAST)) { - assert.fail(null, null, "Rule should not modify AST."); + assert.fail("Rule should not modify AST."); } } @@ -551,7 +551,7 @@ class RuleTester { } else { // Message was an unexpected type - assert.fail(message, null, "Error should be a string, object, or RegExp."); + assert.fail(`Error should be a string, object, or RegExp, but found (${util.inspect(message)})`); } } } diff --git a/tools/node_modules/eslint/node_modules/acorn-jsx/README.md b/tools/node_modules/eslint/node_modules/acorn-jsx/README.md index cd9674c0b38b03..2bbb1d99fd8cfa 100644 --- a/tools/node_modules/eslint/node_modules/acorn-jsx/README.md +++ b/tools/node_modules/eslint/node_modules/acorn-jsx/README.md @@ -17,44 +17,24 @@ Please note that this tool only parses source code to JSX AST, which is useful f ## Usage -You can use module directly in order to get Acorn instance with plugin installed: +Requiring this module provides you with an Acorn plugin that you can use like this: ```javascript -var acorn = require('acorn-jsx'); -``` - -Or you can use `inject.js` for injecting plugin into your own version of Acorn like following: - -```javascript -var acorn = require('acorn-jsx/inject')(require('./custom-acorn')); -``` - -Then, use `plugins` option whenever you need to support JSX while parsing: - -```javascript -var ast = acorn.parse(code, { - plugins: { jsx: true } -}); +var acorn = require("acorn"); +var jsx = require("acorn-jsx"); +acorn.Parser.extend(jsx()).parse("my(, 'code');"); ``` Note that official spec doesn't support mix of XML namespaces and object-style access in tag names (#27) like in ``, so it was deprecated in `acorn-jsx@3.0`. If you still want to opt-in to support of such constructions, you can pass the following option: ```javascript -var ast = acorn.parse(code, { - plugins: { - jsx: { allowNamespacedObjects: true } - } -}); +acorn.Parser.extend(jsx({ allowNamespacedObjects: true })) ``` Also, since most apps use pure React transformer, a new option was introduced that allows to prohibit namespaces completely: ```javascript -var ast = acorn.parse(code, { - plugins: { - jsx: { allowNamespaces: false } - } -}); +acorn.Parser.extend(jsx({ allowNamespaces: false })) ``` Note that by default `allowNamespaces` is enabled for spec compliancy. diff --git a/tools/node_modules/eslint/node_modules/acorn-jsx/index.js b/tools/node_modules/eslint/node_modules/acorn-jsx/index.js index 58c8677740ce26..292315f65bfc90 100644 --- a/tools/node_modules/eslint/node_modules/acorn-jsx/index.js +++ b/tools/node_modules/eslint/node_modules/acorn-jsx/index.js @@ -1,3 +1,431 @@ -'use strict'; +const XHTMLEntities = require('./xhtml'); -module.exports = require('./inject')(require('acorn')); +const hexNumber = /^[\da-fA-F]+$/; +const decimalNumber = /^\d+$/; + +const {tokTypes: tt, TokContext, tokContexts, TokenType, isNewLine, isIdentifierStart, isIdentifierChar} = require("acorn"); + +const tc_oTag = new TokContext('...', true, true); + +const tok = { + jsxName: new TokenType('jsxName'), + jsxText: new TokenType('jsxText', {beforeExpr: true}), + jsxTagStart: new TokenType('jsxTagStart'), + jsxTagEnd: new TokenType('jsxTagEnd') +} + +tok.jsxTagStart.updateContext = function() { + this.context.push(tc_expr); // treat as beginning of JSX expression + this.context.push(tc_oTag); // start opening tag context + this.exprAllowed = false; +}; +tok.jsxTagEnd.updateContext = function(prevType) { + let out = this.context.pop(); + if (out === tc_oTag && prevType === tt.slash || out === tc_cTag) { + this.context.pop(); + this.exprAllowed = this.curContext() === tc_expr; + } else { + this.exprAllowed = true; + } +}; + +// Transforms JSX element name to string. + +function getQualifiedJSXName(object) { + if (!object) + return object; + + if (object.type === 'JSXIdentifier') + return object.name; + + if (object.type === 'JSXNamespacedName') + return object.namespace.name + ':' + object.name.name; + + if (object.type === 'JSXMemberExpression') + return getQualifiedJSXName(object.object) + '.' + + getQualifiedJSXName(object.property); +} + +module.exports = function(options = {}) { + return function(Parser) { + return plugin({ + allowNamespaces: options.allowNamespaces !== false, + allowNamespacedObjects: !!options.allowNamespacedObjects + }, Parser); + } +} +module.exports.tokTypes = tok + +function plugin(options, Parser) { + return class extends Parser { + // Reads inline JSX contents token. + jsx_readToken() { + let out = '', chunkStart = this.pos; + for (;;) { + if (this.pos >= this.input.length) + this.raise(this.start, 'Unterminated JSX contents'); + let ch = this.input.charCodeAt(this.pos); + + switch (ch) { + case 60: // '<' + case 123: // '{' + if (this.pos === this.start) { + if (ch === 60 && this.exprAllowed) { + ++this.pos; + return this.finishToken(tok.jsxTagStart); + } + return this.getTokenFromCode(ch); + } + out += this.input.slice(chunkStart, this.pos); + return this.finishToken(tok.jsxText, out); + + case 38: // '&' + out += this.input.slice(chunkStart, this.pos); + out += this.jsx_readEntity(); + chunkStart = this.pos; + break; + + default: + if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.pos); + out += this.jsx_readNewLine(true); + chunkStart = this.pos; + } else { + ++this.pos; + } + } + } + } + + jsx_readNewLine(normalizeCRLF) { + let ch = this.input.charCodeAt(this.pos); + let out; + ++this.pos; + if (ch === 13 && this.input.charCodeAt(this.pos) === 10) { + ++this.pos; + out = normalizeCRLF ? '\n' : '\r\n'; + } else { + out = String.fromCharCode(ch); + } + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + + return out; + }; + + jsx_readString(quote) { + let out = '', chunkStart = ++this.pos; + for (;;) { + if (this.pos >= this.input.length) + this.raise(this.start, 'Unterminated string constant'); + let ch = this.input.charCodeAt(this.pos); + if (ch === quote) break; + if (ch === 38) { // '&' + out += this.input.slice(chunkStart, this.pos); + out += this.jsx_readEntity(); + chunkStart = this.pos; + } else if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.pos); + out += this.jsx_readNewLine(false); + chunkStart = this.pos; + } else { + ++this.pos; + } + } + out += this.input.slice(chunkStart, this.pos++); + return this.finishToken(tt.string, out); + } + + jsx_readEntity() { + let str = '', count = 0, entity; + let ch = this.input[this.pos]; + if (ch !== '&') + this.raise(this.pos, 'Entity must start with an ampersand'); + let startPos = ++this.pos; + while (this.pos < this.input.length && count++ < 10) { + ch = this.input[this.pos++]; + if (ch === ';') { + if (str[0] === '#') { + if (str[1] === 'x') { + str = str.substr(2); + if (hexNumber.test(str)) + entity = String.fromCharCode(parseInt(str, 16)); + } else { + str = str.substr(1); + if (decimalNumber.test(str)) + entity = String.fromCharCode(parseInt(str, 10)); + } + } else { + entity = XHTMLEntities[str]; + } + break; + } + str += ch; + } + if (!entity) { + this.pos = startPos; + return '&'; + } + return entity; + } + + // Read a JSX identifier (valid tag or attribute name). + // + // Optimized version since JSX identifiers can't contain + // escape characters and so can be read as single slice. + // Also assumes that first character was already checked + // by isIdentifierStart in readToken. + + jsx_readWord() { + let ch, start = this.pos; + do { + ch = this.input.charCodeAt(++this.pos); + } while (isIdentifierChar(ch) || ch === 45); // '-' + return this.finishToken(tok.jsxName, this.input.slice(start, this.pos)); + } + + // Parse next token as JSX identifier + + jsx_parseIdentifier() { + let node = this.startNode(); + if (this.type === tok.jsxName) + node.name = this.value; + else if (this.type.keyword) + node.name = this.type.keyword; + else + this.unexpected(); + this.next(); + return this.finishNode(node, 'JSXIdentifier'); + } + + // Parse namespaced identifier. + + jsx_parseNamespacedName() { + let startPos = this.start, startLoc = this.startLoc; + let name = this.jsx_parseIdentifier(); + if (!options.allowNamespaces || !this.eat(tt.colon)) return name; + var node = this.startNodeAt(startPos, startLoc); + node.namespace = name; + node.name = this.jsx_parseIdentifier(); + return this.finishNode(node, 'JSXNamespacedName'); + } + + // Parses element name in any form - namespaced, member + // or single identifier. + + jsx_parseElementName() { + if (this.type === tok.jsxTagEnd) return ''; + let startPos = this.start, startLoc = this.startLoc; + let node = this.jsx_parseNamespacedName(); + if (this.type === tt.dot && node.type === 'JSXNamespacedName' && !options.allowNamespacedObjects) { + this.unexpected(); + } + while (this.eat(tt.dot)) { + let newNode = this.startNodeAt(startPos, startLoc); + newNode.object = node; + newNode.property = this.jsx_parseIdentifier(); + node = this.finishNode(newNode, 'JSXMemberExpression'); + } + return node; + } + + // Parses any type of JSX attribute value. + + jsx_parseAttributeValue() { + switch (this.type) { + case tt.braceL: + let node = this.jsx_parseExpressionContainer(); + if (node.expression.type === 'JSXEmptyExpression') + this.raise(node.start, 'JSX attributes must only be assigned a non-empty expression'); + return node; + + case tok.jsxTagStart: + case tt.string: + return this.parseExprAtom(); + + default: + this.raise(this.start, 'JSX value should be either an expression or a quoted JSX text'); + } + } + + // JSXEmptyExpression is unique type since it doesn't actually parse anything, + // and so it should start at the end of last read token (left brace) and finish + // at the beginning of the next one (right brace). + + jsx_parseEmptyExpression() { + let node = this.startNodeAt(this.lastTokEnd, this.lastTokEndLoc); + return this.finishNodeAt(node, 'JSXEmptyExpression', this.start, this.startLoc); + } + + // Parses JSX expression enclosed into curly brackets. + + jsx_parseExpressionContainer() { + let node = this.startNode(); + this.next(); + node.expression = this.type === tt.braceR + ? this.jsx_parseEmptyExpression() + : this.parseExpression(); + this.expect(tt.braceR); + return this.finishNode(node, 'JSXExpressionContainer'); + } + + // Parses following JSX attribute name-value pair. + + jsx_parseAttribute() { + let node = this.startNode(); + if (this.eat(tt.braceL)) { + this.expect(tt.ellipsis); + node.argument = this.parseMaybeAssign(); + this.expect(tt.braceR); + return this.finishNode(node, 'JSXSpreadAttribute'); + } + node.name = this.jsx_parseNamespacedName(); + node.value = this.eat(tt.eq) ? this.jsx_parseAttributeValue() : null; + return this.finishNode(node, 'JSXAttribute'); + } + + // Parses JSX opening tag starting after '<'. + + jsx_parseOpeningElementAt(startPos, startLoc) { + let node = this.startNodeAt(startPos, startLoc); + node.attributes = []; + let nodeName = this.jsx_parseElementName(); + if (nodeName) node.name = nodeName; + while (this.type !== tt.slash && this.type !== tok.jsxTagEnd) + node.attributes.push(this.jsx_parseAttribute()); + node.selfClosing = this.eat(tt.slash); + this.expect(tok.jsxTagEnd); + return this.finishNode(node, nodeName ? 'JSXOpeningElement' : 'JSXOpeningFragment'); + } + + // Parses JSX closing tag starting after ''); + } + } + let fragmentOrElement = openingElement.name ? 'Element' : 'Fragment'; + + node['opening' + fragmentOrElement] = openingElement; + node['closing' + fragmentOrElement] = closingElement; + node.children = children; + if (this.type === tt.relational && this.value === "<") { + this.raise(this.start, "Adjacent JSX elements must be wrapped in an enclosing tag"); + } + return this.finishNode(node, 'JSX' + fragmentOrElement); + } + + // Parse JSX text + + jsx_parseText(value) { + let node = this.parseLiteral(value); + node.type = "JSXText"; + return node; + } + + // Parses entire JSX element from current position. + + jsx_parseElement() { + let startPos = this.start, startLoc = this.startLoc; + this.next(); + return this.jsx_parseElementAt(startPos, startLoc); + } + + parseExprAtom(refShortHandDefaultPos) { + if (this.type === tok.jsxText) + return this.jsx_parseText(this.value); + else if (this.type === tok.jsxTagStart) + return this.jsx_parseElement(); + else + return super.parseExprAtom(refShortHandDefaultPos); + } + + readToken(code) { + let context = this.curContext(); + + if (context === tc_expr) return this.jsx_readToken(); + + if (context === tc_oTag || context === tc_cTag) { + if (isIdentifierStart(code)) return this.jsx_readWord(); + + if (code == 62) { + ++this.pos; + return this.finishToken(tok.jsxTagEnd); + } + + if ((code === 34 || code === 39) && context == tc_oTag) + return this.jsx_readString(code); + } + + if (code === 60 && this.exprAllowed && this.input.charCodeAt(this.pos + 1) !== 33) { + ++this.pos; + return this.finishToken(tok.jsxTagStart); + } + return super.readToken(code) + } + + updateContext(prevType) { + if (this.type == tt.braceL) { + var curContext = this.curContext(); + if (curContext == tc_oTag) this.context.push(tokContexts.b_expr); + else if (curContext == tc_expr) this.context.push(tokContexts.b_tmpl); + else super.updateContext(prevType) + this.exprAllowed = true; + } else if (this.type === tt.slash && prevType === tok.jsxTagStart) { + this.context.length -= 2; // do not consider JSX expr -> JSX open tag -> ... anymore + this.context.push(tc_cTag); // reconsider as closing tag context + this.exprAllowed = false; + } else { + return super.updateContext(prevType); + } + } + }; +}; diff --git a/tools/node_modules/eslint/node_modules/acorn-jsx/inject.js b/tools/node_modules/eslint/node_modules/acorn-jsx/inject.js deleted file mode 100644 index 33806c72ce0a1c..00000000000000 --- a/tools/node_modules/eslint/node_modules/acorn-jsx/inject.js +++ /dev/null @@ -1,449 +0,0 @@ -'use strict'; - -var XHTMLEntities = require('./xhtml'); - -var hexNumber = /^[\da-fA-F]+$/; -var decimalNumber = /^\d+$/; - -module.exports = function(acorn) { - var tt = acorn.tokTypes; - var tc = acorn.tokContexts; - - tc.j_oTag = new acorn.TokContext('...', true, true); - - tt.jsxName = new acorn.TokenType('jsxName'); - tt.jsxText = new acorn.TokenType('jsxText', {beforeExpr: true}); - tt.jsxTagStart = new acorn.TokenType('jsxTagStart'); - tt.jsxTagEnd = new acorn.TokenType('jsxTagEnd'); - - tt.jsxTagStart.updateContext = function() { - this.context.push(tc.j_expr); // treat as beginning of JSX expression - this.context.push(tc.j_oTag); // start opening tag context - this.exprAllowed = false; - }; - tt.jsxTagEnd.updateContext = function(prevType) { - var out = this.context.pop(); - if (out === tc.j_oTag && prevType === tt.slash || out === tc.j_cTag) { - this.context.pop(); - this.exprAllowed = this.curContext() === tc.j_expr; - } else { - this.exprAllowed = true; - } - }; - - var pp = acorn.Parser.prototype; - - // Reads inline JSX contents token. - - pp.jsx_readToken = function() { - var out = '', chunkStart = this.pos; - for (;;) { - if (this.pos >= this.input.length) - this.raise(this.start, 'Unterminated JSX contents'); - var ch = this.input.charCodeAt(this.pos); - - switch (ch) { - case 60: // '<' - case 123: // '{' - if (this.pos === this.start) { - if (ch === 60 && this.exprAllowed) { - ++this.pos; - return this.finishToken(tt.jsxTagStart); - } - return this.getTokenFromCode(ch); - } - out += this.input.slice(chunkStart, this.pos); - return this.finishToken(tt.jsxText, out); - - case 38: // '&' - out += this.input.slice(chunkStart, this.pos); - out += this.jsx_readEntity(); - chunkStart = this.pos; - break; - - default: - if (acorn.isNewLine(ch)) { - out += this.input.slice(chunkStart, this.pos); - out += this.jsx_readNewLine(true); - chunkStart = this.pos; - } else { - ++this.pos; - } - } - } - }; - - pp.jsx_readNewLine = function(normalizeCRLF) { - var ch = this.input.charCodeAt(this.pos); - var out; - ++this.pos; - if (ch === 13 && this.input.charCodeAt(this.pos) === 10) { - ++this.pos; - out = normalizeCRLF ? '\n' : '\r\n'; - } else { - out = String.fromCharCode(ch); - } - if (this.options.locations) { - ++this.curLine; - this.lineStart = this.pos; - } - - return out; - }; - - pp.jsx_readString = function(quote) { - var out = '', chunkStart = ++this.pos; - for (;;) { - if (this.pos >= this.input.length) - this.raise(this.start, 'Unterminated string constant'); - var ch = this.input.charCodeAt(this.pos); - if (ch === quote) break; - if (ch === 38) { // '&' - out += this.input.slice(chunkStart, this.pos); - out += this.jsx_readEntity(); - chunkStart = this.pos; - } else if (acorn.isNewLine(ch)) { - out += this.input.slice(chunkStart, this.pos); - out += this.jsx_readNewLine(false); - chunkStart = this.pos; - } else { - ++this.pos; - } - } - out += this.input.slice(chunkStart, this.pos++); - return this.finishToken(tt.string, out); - }; - - pp.jsx_readEntity = function() { - var str = '', count = 0, entity; - var ch = this.input[this.pos]; - if (ch !== '&') - this.raise(this.pos, 'Entity must start with an ampersand'); - var startPos = ++this.pos; - while (this.pos < this.input.length && count++ < 10) { - ch = this.input[this.pos++]; - if (ch === ';') { - if (str[0] === '#') { - if (str[1] === 'x') { - str = str.substr(2); - if (hexNumber.test(str)) - entity = String.fromCharCode(parseInt(str, 16)); - } else { - str = str.substr(1); - if (decimalNumber.test(str)) - entity = String.fromCharCode(parseInt(str, 10)); - } - } else { - entity = XHTMLEntities[str]; - } - break; - } - str += ch; - } - if (!entity) { - this.pos = startPos; - return '&'; - } - return entity; - }; - - - // Read a JSX identifier (valid tag or attribute name). - // - // Optimized version since JSX identifiers can't contain - // escape characters and so can be read as single slice. - // Also assumes that first character was already checked - // by isIdentifierStart in readToken. - - pp.jsx_readWord = function() { - var ch, start = this.pos; - do { - ch = this.input.charCodeAt(++this.pos); - } while (acorn.isIdentifierChar(ch) || ch === 45); // '-' - return this.finishToken(tt.jsxName, this.input.slice(start, this.pos)); - }; - - // Transforms JSX element name to string. - - function getQualifiedJSXName(object) { - if (!object) - return object; - - if (object.type === 'JSXIdentifier') - return object.name; - - if (object.type === 'JSXNamespacedName') - return object.namespace.name + ':' + object.name.name; - - if (object.type === 'JSXMemberExpression') - return getQualifiedJSXName(object.object) + '.' + - getQualifiedJSXName(object.property); - } - - // Parse next token as JSX identifier - - pp.jsx_parseIdentifier = function() { - var node = this.startNode(); - if (this.type === tt.jsxName) - node.name = this.value; - else if (this.type.keyword) - node.name = this.type.keyword; - else - this.unexpected(); - this.next(); - return this.finishNode(node, 'JSXIdentifier'); - }; - - // Parse namespaced identifier. - - pp.jsx_parseNamespacedName = function() { - var startPos = this.start, startLoc = this.startLoc; - var name = this.jsx_parseIdentifier(); - if (!this.options.plugins.jsx.allowNamespaces || !this.eat(tt.colon)) return name; - var node = this.startNodeAt(startPos, startLoc); - node.namespace = name; - node.name = this.jsx_parseIdentifier(); - return this.finishNode(node, 'JSXNamespacedName'); - }; - - // Parses element name in any form - namespaced, member - // or single identifier. - - pp.jsx_parseElementName = function() { - if (this.type === tt.jsxTagEnd) - return ''; - var startPos = this.start, startLoc = this.startLoc; - var node = this.jsx_parseNamespacedName(); - if (this.type === tt.dot && node.type === 'JSXNamespacedName' && !this.options.plugins.jsx.allowNamespacedObjects) { - this.unexpected(); - } - while (this.eat(tt.dot)) { - var newNode = this.startNodeAt(startPos, startLoc); - newNode.object = node; - newNode.property = this.jsx_parseIdentifier(); - node = this.finishNode(newNode, 'JSXMemberExpression'); - } - return node; - }; - - // Parses any type of JSX attribute value. - - pp.jsx_parseAttributeValue = function() { - switch (this.type) { - case tt.braceL: - var node = this.jsx_parseExpressionContainer(); - if (node.expression.type === 'JSXEmptyExpression') - this.raise(node.start, 'JSX attributes must only be assigned a non-empty expression'); - return node; - - case tt.jsxTagStart: - case tt.string: - return this.parseExprAtom(); - - default: - this.raise(this.start, 'JSX value should be either an expression or a quoted JSX text'); - } - }; - - // JSXEmptyExpression is unique type since it doesn't actually parse anything, - // and so it should start at the end of last read token (left brace) and finish - // at the beginning of the next one (right brace). - - pp.jsx_parseEmptyExpression = function() { - var node = this.startNodeAt(this.lastTokEnd, this.lastTokEndLoc); - return this.finishNodeAt(node, 'JSXEmptyExpression', this.start, this.startLoc); - }; - - // Parses JSX expression enclosed into curly brackets. - - - pp.jsx_parseExpressionContainer = function() { - var node = this.startNode(); - this.next(); - node.expression = this.type === tt.braceR - ? this.jsx_parseEmptyExpression() - : this.parseExpression(); - this.expect(tt.braceR); - return this.finishNode(node, 'JSXExpressionContainer'); - }; - - // Parses following JSX attribute name-value pair. - - pp.jsx_parseAttribute = function() { - var node = this.startNode(); - if (this.eat(tt.braceL)) { - this.expect(tt.ellipsis); - node.argument = this.parseMaybeAssign(); - this.expect(tt.braceR); - return this.finishNode(node, 'JSXSpreadAttribute'); - } - node.name = this.jsx_parseNamespacedName(); - node.value = this.eat(tt.eq) ? this.jsx_parseAttributeValue() : null; - return this.finishNode(node, 'JSXAttribute'); - }; - - // Parses JSX opening tag starting after '<'. - - pp.jsx_parseOpeningElementAt = function(startPos, startLoc) { - var node = this.startNodeAt(startPos, startLoc); - node.attributes = []; - var nodeName = this.jsx_parseElementName(); - if (nodeName) node.name = nodeName; - while (this.type !== tt.slash && this.type !== tt.jsxTagEnd) - node.attributes.push(this.jsx_parseAttribute()); - node.selfClosing = this.eat(tt.slash); - this.expect(tt.jsxTagEnd); - return this.finishNode(node, nodeName ? 'JSXOpeningElement' : 'JSXOpeningFragment'); - }; - - // Parses JSX closing tag starting after ''); - } - } - - node.openingElement = openingElement; - node.closingElement = closingElement; - node.children = children; - if (this.type === tt.relational && this.value === "<") { - this.raise(this.start, "Adjacent JSX elements must be wrapped in an enclosing tag"); - } - return this.finishNode(node, openingElement.name ? 'JSXElement' : 'JSXFragment'); - }; - - // Parse JSX text - - pp.jsx_parseText = function(value) { - var node = this.parseLiteral(value); - node.type = "JSXText"; - - return node; - }; - - // Parses entire JSX element from current position. - - pp.jsx_parseElement = function() { - var startPos = this.start, startLoc = this.startLoc; - this.next(); - return this.jsx_parseElementAt(startPos, startLoc); - }; - - acorn.plugins.jsx = function(instance, opts) { - if (!opts) { - return; - } - - if (typeof opts !== 'object') { - opts = {}; - } - - instance.options.plugins.jsx = { - allowNamespaces: opts.allowNamespaces !== false, - allowNamespacedObjects: !!opts.allowNamespacedObjects - }; - - instance.extend('parseExprAtom', function(inner) { - return function(refShortHandDefaultPos) { - if (this.type === tt.jsxText) - return this.jsx_parseText(this.value); - else if (this.type === tt.jsxTagStart) - return this.jsx_parseElement(); - else - return inner.call(this, refShortHandDefaultPos); - }; - }); - - instance.extend('readToken', function(inner) { - return function(code) { - var context = this.curContext(); - - if (context === tc.j_expr) return this.jsx_readToken(); - - if (context === tc.j_oTag || context === tc.j_cTag) { - if (acorn.isIdentifierStart(code)) return this.jsx_readWord(); - - if (code == 62) { - ++this.pos; - return this.finishToken(tt.jsxTagEnd); - } - - if ((code === 34 || code === 39) && context == tc.j_oTag) - return this.jsx_readString(code); - } - - if (code === 60 && this.exprAllowed && this.input.charCodeAt(this.pos + 1) !== 33) { - ++this.pos; - return this.finishToken(tt.jsxTagStart); - } - return inner.call(this, code); - }; - }); - - instance.extend('updateContext', function(inner) { - return function(prevType) { - if (this.type == tt.braceL) { - var curContext = this.curContext(); - if (curContext == tc.j_oTag) this.context.push(tc.b_expr); - else if (curContext == tc.j_expr) this.context.push(tc.b_tmpl); - else inner.call(this, prevType); - this.exprAllowed = true; - } else if (this.type === tt.slash && prevType === tt.jsxTagStart) { - this.context.length -= 2; // do not consider JSX expr -> JSX open tag -> ... anymore - this.context.push(tc.j_cTag); // reconsider as closing tag context - this.exprAllowed = false; - } else { - return inner.call(this, prevType); - } - }; - }); - }; - - return acorn; -}; diff --git a/tools/node_modules/eslint/node_modules/acorn-jsx/package.json b/tools/node_modules/eslint/node_modules/acorn-jsx/package.json index 138fee460f07f0..d22757b6a8d450 100644 --- a/tools/node_modules/eslint/node_modules/acorn-jsx/package.json +++ b/tools/node_modules/eslint/node_modules/acorn-jsx/package.json @@ -3,14 +3,10 @@ "url": "https://github.com/RReverser/acorn-jsx/issues" }, "bundleDependencies": false, - "dependencies": { - "acorn": "^5.0.3" - }, "deprecated": false, "description": "Alternative, faster React.js JSX parser", "devDependencies": { - "chai": "^3.0.0", - "mocha": "^3.3.0" + "acorn": "^6.0.0" }, "homepage": "https://github.com/RReverser/acorn-jsx", "license": "MIT", @@ -22,6 +18,9 @@ } ], "name": "acorn-jsx", + "peerDependencies": { + "acorn": "^6.0.0" + }, "repository": { "type": "git", "url": "git+https://github.com/RReverser/acorn-jsx.git" @@ -29,5 +28,5 @@ "scripts": { "test": "node test/run.js" }, - "version": "4.1.1" + "version": "5.0.0" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/acorn/AUTHORS b/tools/node_modules/eslint/node_modules/acorn/AUTHORS deleted file mode 100644 index c5ac22cbd7c6ba..00000000000000 --- a/tools/node_modules/eslint/node_modules/acorn/AUTHORS +++ /dev/null @@ -1,79 +0,0 @@ -List of Acorn contributors. Updated before every release. - -Adrian Heine -Adrian Rakovsky -Alistair Braidwood -Amila Welihinda -Andres Suarez -Angelo -Aparajita Fishman -Arian Stolwijk -Artem Govorov -Boopesh Mahendran -Bradley Heinz -Brandon Mills -Charles Hughes -Charmander -Chris McKnight -Conrad Irwin -Daniel Tschinder -David Bonnet -Domenico Matteo -ehmicky -Eugene Obrezkov -Felix Maier -Forbes Lindesay -Gilad Peleg -impinball -Ingvar Stepanyan -Jackson Ray Hamilton -Jesse McCarthy -Jiaxing Wang -Joel Kemp -Johannes Herr -John-David Dalton -Jordan Klassen -Jürg Lehni -Kai Cataldo -keeyipchan -Keheliya Gallaba -Kevin Irish -Kevin Kwok -krator -laosb -luckyzeng -Marek -Marijn Haverbeke -Martin Carlberg -Mat Garcia -Mathias Bynens -Mathieu 'p01' Henri -Matthew Bastien -Max Schaefer -Max Zerzouri -Mihai Bazon -Mike Rennie -naoh -Nicholas C. Zakas -Nick Fitzgerald -Olivier Thomann -Oskar Schöldström -Paul Harper -Peter Rust -PlNG -Prayag Verma -ReadmeCritic -r-e-d -Renée Kooi -Richard Gibson -Rich Harris -Sebastian McKenzie -Shahar Soel -Sheel Bedi -Simen Bekkhus -Teddy Katz -Timothy Gu -Toru Nagashima -Victor Homyakov -Wexpo Lyu -zsjforcn diff --git a/tools/node_modules/eslint/node_modules/acorn/README.md b/tools/node_modules/eslint/node_modules/acorn/README.md index de53f513f49e2f..e66dac31de22b2 100644 --- a/tools/node_modules/eslint/node_modules/acorn/README.md +++ b/tools/node_modules/eslint/node_modules/acorn/README.md @@ -1,11 +1,6 @@ # Acorn -[![Build Status](https://travis-ci.org/acornjs/acorn.svg?branch=master)](https://travis-ci.org/acornjs/acorn) -[![NPM version](https://img.shields.io/npm/v/acorn.svg)](https://www.npmjs.com/package/acorn) -[![CDNJS](https://img.shields.io/cdnjs/v/acorn.svg)](https://cdnjs.com/libraries/acorn) -[Author funding status: ![maintainer happiness](https://marijnhaverbeke.nl/fund/status_s.png?force)](https://marijnhaverbeke.nl/fund/) - -A tiny, fast JavaScript parser, written completely in JavaScript. +A tiny, fast JavaScript parser written in JavaScript. ## Community @@ -20,9 +15,7 @@ and discussion, please use the ## Installation -The easiest way to install acorn is with [`npm`][npm]. - -[npm]: https://www.npmjs.com/ +The easiest way to install acorn is from [`npm`](https://www.npmjs.com/): ```sh npm install acorn @@ -34,36 +27,29 @@ Alternately, you can download the source and build acorn yourself: git clone https://github.com/acornjs/acorn.git cd acorn npm install -npm run build ``` -## Components - -When run in a CommonJS (node.js) or AMD environment, exported values -appear in the interfaces exposed by the individual files, as usual. -When loaded in the browser (Acorn works in any JS-enabled browser more -recent than IE5) without any kind of module management, a single -global object `acorn` will be defined, and all the exported properties -will be added to that. +## Interface -### Main parser +**parse**`(input, options)` is the main interface to the library. The +`input` parameter is a string, `options` can be undefined or an object +setting some of the options listed below. The return value will be an +abstract syntax tree object as specified by the [ESTree +spec](https://github.com/estree/estree). -This is implemented in `dist/acorn.js`, and is what you get when you -`require("acorn")` in node.js. - -**parse**`(input, options)` is used to parse a JavaScript program. -The `input` parameter is a string, `options` can be undefined or an -object setting some of the options listed below. The return value will -be an abstract syntax tree object as specified by the -[ESTree spec][estree]. +```javascript +let acorn = require("acorn"); +console.log(acorn.parse("1 + 1")); +``` -When encountering a syntax error, the parser will raise a -`SyntaxError` object with a meaningful message. The error object will -have a `pos` property that indicates the character offset at which the -error occurred, and a `loc` object that contains a `{line, column}` +When encountering a syntax error, the parser will raise a +`SyntaxError` object with a meaningful message. The error object will +have a `pos` property that indicates the string offset at which the +error occurred, and a `loc` object that contains a `{line, column}` object referring to that same position. -[estree]: https://github.com/estree/estree +Options can be provided by passing a second argument, which should be +an object containing any of these fields: - **ecmaVersion**: Indicates the ECMAScript version to parse. Must be either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018) or 10 (2019, partial @@ -71,7 +57,8 @@ object referring to that same position. reserved words, and support for new syntax features. Default is 7. **NOTE**: Only 'stage 4' (finalized) ECMAScript features are being - implemented by Acorn. + implemented by Acorn. Other proposed new features can be implemented + through plugins. - **sourceType**: Indicate the mode the code should be parsed in. Can be either `"script"` or `"module"`. This influences global strict mode @@ -100,7 +87,10 @@ object referring to that same position. declarations can only appear at a program's top level. Setting this option to `true` allows them anywhere where a statement is allowed. -- **allowAwaitOutsideFunction**: By default, `await` expressions can only appear inside `async` functions. Setting this option to `true` allows to have top-level `await` expressions. They are still not allowed in non-`async` functions, though. +- **allowAwaitOutsideFunction**: By default, `await` expressions can + only appear inside `async` functions. Setting this option to + `true` allows to have top-level `await` expressions. They are + still not allowed in non-`async` functions, though. - **allowHashBang**: When this is enabled (off by default), if the code starts with the characters `#!` (as in a shellscript), the @@ -159,9 +149,10 @@ object referring to that same position. - **ranges**: 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`. + add a + [semi-standardized](https://bugzilla.mozilla.org/show_bug.cgi?id=745678) + `range` property holding a `[start, end]` array with the same + numbers, set the `ranges` option to `true`. - **program**: It is possible to parse multiple files into a single AST by passing the tree produced by parsing the first file as the @@ -184,15 +175,10 @@ object referring to that same position. that have a single `expression` property containing the expression inside parentheses. -[range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 - **parseExpressionAt**`(input, offset, options)` will parse a single expression in a string, and return its AST. It will not complain if there is more of the string left after the expression. -**getLineInfo**`(input, offset)` can be used to get a `{line, -column}` object for a given program string and character offset. - **tokenizer**`(input, options)` returns an object with a `getToken` method that can be called repeatedly to get the next token, a `{start, end, type, value}` object (with added `loc` property when the @@ -216,139 +202,30 @@ var tokens = [...acorn.tokenizer(str)]; **tokTypes** holds an object mapping names to the token type objects that end up in the `type` properties of tokens. -#### Note on using with [Escodegen][escodegen] - -Escodegen supports generating comments from AST, attached in -Esprima-specific format. In order to simulate same format in -Acorn, consider following example: - -```javascript -var comments = [], tokens = []; - -var ast = acorn.parse('var x = 42; // answer', { - // collect ranges for each node - ranges: true, - // collect comments in Esprima's format - onComment: comments, - // collect token ranges - onToken: tokens -}); - -// attach comments using collected information -escodegen.attachComments(ast, comments, tokens); - -// generate code -console.log(escodegen.generate(ast, {comment: true})); -// > 'var x = 42; // answer' -``` - -[escodegen]: https://github.com/estools/escodegen - -### dist/acorn_loose.js ### - -This file implements an error-tolerant parser. It exposes a single -function. The loose parser is accessible in node.js via `require("acorn/dist/acorn_loose")`. - -**parse_dammit**`(input, options)` takes the same arguments and -returns the same syntax tree as the `parse` function in `acorn.js`, -but never raises an error, and will do its best to parse syntactically -invalid code in as meaningful a way as it can. It'll insert identifier -nodes with name `"✖"` as placeholders in places where it can't make -sense of the input. Depends on `acorn.js`, because it uses the same -tokenizer. - -### dist/walk.js ### - -Implements an abstract syntax tree walker. Will store its interface in -`acorn.walk` when loaded without a module system. - -**simple**`(node, visitors, base, state)` does a 'simple' walk over -a tree. `node` should be the AST node to walk, and `visitors` an -object with properties whose names correspond to node types in the -[ESTree spec][estree]. The properties should contain functions -that will be called with the node object and, if applicable the state -at that point. The last two arguments are optional. `base` is a walker -algorithm, and `state` is a start state. The default walker will -simply visit all statements and expressions and not produce a -meaningful state. (An example of a use of state is to track scope at -each point in the tree.) - -```js -const acorn = require("acorn") -const walk = require("acorn/dist/walk") - -walk.simple(acorn.parse("let x = 10"), { - Literal(node) { - console.log(`Found a literal: ${node.value}`) - } -}) -``` +**getLineInfo**`(input, offset)` can be used to get a `{line, +column}` object for a given program string and offset. -**ancestor**`(node, visitors, base, state)` does a 'simple' walk over -a tree, building up an array of ancestor nodes (including the current node) -and passing the array to the callbacks as a third parameter. +### The `Parser` class -```js -const acorn = require("acorn") -const walk = require("acorn/dist/walk") +Instances of the **`Parser`** class contain all the state and logic +that drives a parse. It has static methods `parse`, +`parseExpressionAt`, and `tokenizer` that match the top-level +functions by the same name. -walk.ancestor(acorn.parse("foo('hi')"), { - Literal(_, ancestors) { - console.log("This literal's ancestors are:", - ancestors.map(n => n.type)) - } -}) -``` +When extending the parser with plugins, you need to call these methods +on the extended version of the class. To extend a parser with plugins, +you can use its static `extend` method. -**recursive**`(node, state, functions, base)` does a 'recursive' -walk, where the walker functions are responsible for continuing the -walk on the child nodes of their target node. `state` is the start -state, and `functions` should contain an object that maps node types -to walker functions. Such functions are called with `(node, state, c)` -arguments, and can cause the walk to continue on a sub-node by calling -the `c` argument on it with `(node, state)` arguments. The optional -`base` argument provides the fallback walker functions for node types -that aren't handled in the `functions` object. If not given, the -default walkers will be used. - -**make**`(functions, base)` builds a new walker object by using the -walker functions in `functions` and filling in the missing ones by -taking defaults from `base`. - -**full**`(node, callback, base, state)` does a 'full' -walk over a tree, calling the callback with the arguments (node, state, type) -for each node - -**fullAncestor**`(node, callback, base, state)` does a 'full' walk over -a tree, building up an array of ancestor nodes (including the current node) -and passing the array to the callbacks as a third parameter. - -```js -const acorn = require("acorn") -const walk = require("acorn/dist/walk") - -walk.full(acorn.parse("1 + 1"), node => { - console.log(`There's a ${node.type} node at ${node.ch}`) -}) +```javascript +var acorn = require("acorn"); +var jsx = require("acorn-jsx"); +var JSXParser = acorn.Parser.extend(jsx()); +JSXParser.parse("foo()"); ``` -**findNodeAt**`(node, start, end, test, base, state)` tries to -locate a node in a tree at the given start and/or end offsets, which -satisfies the predicate `test`. `start` and `end` can be either `null` -(as wildcard) or a number. `test` may be a string (indicating a node -type) or a function that takes `(nodeType, node)` arguments and -returns a boolean indicating whether this node is interesting. `base` -and `state` are optional, and can be used to specify a custom walker. -Nodes are tested from inner to outer, so if two nodes match the -boundaries, the inner one will be preferred. - -**findNodeAround**`(node, pos, test, base, state)` is a lot like -`findNodeAt`, but will match any node that exists 'around' (spanning) -the given position. - -**findNodeAfter**`(node, pos, test, base, state)` is similar to -`findNodeAround`, but will match all nodes *after* the given position -(testing outer nodes before inner nodes). +The `extend` method takes any number of plugin values, and returns a +new `Parser` class that includes the extra parser logic provided by +the plugins. ## Command line interface @@ -357,7 +234,7 @@ line. It accepts as arguments its input file and the following options: - `--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|--ecma10`: Sets the ECMAScript version - to parse. Default is version 7. + to parse. Default is version 9. - `--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise. @@ -365,7 +242,8 @@ options: "end" subobjects, each of which contains the one-based line and zero-based column numbers in `{line, column}` form. -- `--allow-hash-bang`: If the code starts with the characters #! (as in a shellscript), the first line will be treated as a comment. +- `--allow-hash-bang`: If the code starts with the characters #! (as + in a shellscript), the first line will be treated as a comment. - `--compact`: No whitespace is used in the AST output. @@ -375,82 +253,11 @@ options: The utility spits out the syntax tree as JSON data. -## Build system - -Acorn is written in ECMAScript 6, as a set of small modules, in the -project's `src` directory, and compiled down to bigger ECMAScript 3 -files in `dist` using [Browserify](http://browserify.org) and -[Babel](http://babeljs.io/). If you are already using Babel, you can -consider including the modules directly. - -The command-line test runner (`npm test`) uses the ES6 modules. The -browser-based test page (`test/index.html`) uses the compiled modules. -The `bin/build-acorn.js` script builds the latter from the former. - -If you are working on Acorn, you'll probably want to try the code out -directly, without an intermediate build step. In your scripts, you can -register the Babel require shim like this: - - require("babel-core/register") - -That will allow you to directly `require` the ES6 modules. - -## Plugins - -Acorn is designed support allow plugins which, within reasonable -bounds, redefine the way the parser works. Plugins can add new token -types and new tokenizer contexts (if necessary), and extend methods in -the parser object. This is not a clean, elegant API—using it requires -an understanding of Acorn's internals, and plugins are likely to break -whenever those internals are significantly changed. But still, it is -_possible_, in this way, to create parsers for JavaScript dialects -without forking all of Acorn. And in principle it is even possible to -combine such plugins, so that if you have, for example, a plugin for -parsing types and a plugin for parsing JSX-style XML literals, you -could load them both and parse code with both JSX tags and types. - -A plugin should register itself by adding a property to -`acorn.plugins`, which holds a function. Calling `acorn.parse`, a -`plugins` option can be passed, holding an object mapping plugin names -to configuration values (or just `true` for plugins that don't take -options). After the parser object has been created, the initialization -functions for the chosen plugins are called with `(parser, -configValue)` arguments. They are expected to use the `parser.extend` -method to extend parser methods. For example, the `readToken` method -could be extended like this: - -```javascript -parser.extend("readToken", function(nextMethod) { - return function(code) { - console.log("Reading a token!") - return nextMethod.call(this, code) - } -}) -``` - -The `nextMethod` argument passed to `extend`'s second argument is the -previous value of this method, and should usually be called through to -whenever the extended method does not handle the call itself. - -Similarly, the loose parser allows plugins to register themselves via -`acorn.pluginsLoose`. The extension mechanism is the same as for the -normal parser: - -```javascript -looseParser.extend("readToken", function(nextMethod) { - return function() { - console.log("Reading a token in the loose parser!") - return nextMethod.call(this) - } -}) -``` - -### Existing plugins +## Existing plugins - [`acorn-jsx`](https://github.com/RReverser/acorn-jsx): Parse [Facebook JSX syntax extensions](https://github.com/facebook/jsx) - - [`acorn-objj`](https://github.com/cappuccino/acorn-objj): [Objective-J](http://www.cappuccino-project.org/learn/objective-j.html) language parser built as Acorn plugin - Plugins for ECMAScript proposals: +Plugins for ECMAScript proposals: - [`acorn-stage3`](https://github.com/acornjs/acorn-stage3): Parse most stage 3 proposals, bundling: - [`acorn-async-iteration`](https://github.com/acornjs/acorn-async-iteration): Parse [async iteration proposal](https://github.com/tc39/proposal-async-iteration) @@ -459,9 +266,4 @@ looseParser.extend("readToken", function(nextMethod) { - [`acorn-dynamic-import`](https://github.com/kesne/acorn-dynamic-import): Parse [import() proposal](https://github.com/tc39/proposal-dynamic-import) - [`acorn-import-meta`](https://github.com/acornjs/acorn-import-meta): Parse [import.meta proposal](https://github.com/tc39/proposal-import-meta) - [`acorn-numeric-separator`](https://github.com/acornjs/acorn-numeric-separator): Parse [numeric separator proposal](https://github.com/tc39/proposal-numeric-separator) - - [`acorn-optional-catch-binding`](https://github.com/acornjs/acorn-optional-catch-binding): Parse [optional catch binding proposal](https://github.com/tc39/proposal-optional-catch-binding) - - [`acorn-private-methods`](https://github.com/acornjs/acorn-private-methods): parse [private methods, getters and setters proposal](https://github.com/tc39/proposal-private-methods) - - [`acorn5-object-spread`](https://github.com/adrianheine/acorn5-object-spread): Parse [Object Rest/Spread Properties proposal](https://github.com/tc39/proposal-object-rest-spread) - - [`acorn-object-rest-spread`](https://github.com/victor-homyakov/acorn-object-rest-spread): Parse [Object Rest/Spread Properties proposal](https://github.com/tc39/proposal-object-rest-spread) - - [`acorn-es7`](https://github.com/angelozerr/acorn-es7): Parse [decorator syntax proposal](https://github.com/wycats/javascript-decorators) - - [`acorn-static-class-property-initializer`](https://github.com/victor-homyakov/acorn-static-class-property-initializer): Partial support for static class properties from [ES Class Fields & Static Properties Proposal](https://github.com/tc39/proposal-class-public-fields) to support static property initializers in [React components written as ES6+ classes](https://babeljs.io/blog/2015/07/07/react-on-es6-plus) + - [`acorn-private-methods`](https://github.com/acornjs/acorn-private-methods): parse [private methods, getters and setters proposal](https://github.com/tc39/proposal-private-methods)n diff --git a/tools/node_modules/eslint/node_modules/acorn/bin/acorn b/tools/node_modules/eslint/node_modules/acorn/bin/acorn index 03888d0aecac17..cf7df46890fdd4 100755 --- a/tools/node_modules/eslint/node_modules/acorn/bin/acorn +++ b/tools/node_modules/eslint/node_modules/acorn/bin/acorn @@ -1,4 +1,4 @@ #!/usr/bin/env node 'use strict'; -require('./_acorn.js'); +require('../dist/bin.js'); diff --git a/tools/node_modules/eslint/node_modules/acorn/bin/run_test262.js b/tools/node_modules/eslint/node_modules/acorn/bin/run_test262.js deleted file mode 100644 index 150429a1f20957..00000000000000 --- a/tools/node_modules/eslint/node_modules/acorn/bin/run_test262.js +++ /dev/null @@ -1,21 +0,0 @@ -const fs = require("fs") -const path = require("path") -const run = require("test262-parser-runner") -const parse = require("..").parse - -const unsupportedFeatures = [ - "BigInt", - "class-fields", - "class-fields-private", - "class-fields-public", - "numeric-separator-literal" -]; - -run( - (content, {sourceType}) => parse(content, {sourceType, ecmaVersion: 10}), - { - testsDirectory: path.dirname(require.resolve("test262/package.json")), - skip: test => (test.attrs.features && unsupportedFeatures.some(f => test.attrs.features.includes(f))), - whitelist: fs.readFileSync("./bin/test262.whitelist", "utf8").split("\n").filter(v => v) - } -) diff --git a/tools/node_modules/eslint/node_modules/acorn/bin/test262.whitelist b/tools/node_modules/eslint/node_modules/acorn/bin/test262.whitelist deleted file mode 100644 index c8c6ce4a82774b..00000000000000 --- a/tools/node_modules/eslint/node_modules/acorn/bin/test262.whitelist +++ /dev/null @@ -1,404 +0,0 @@ -annexB/language/function-code/block-decl-func-no-skip-try.js (default) -annexB/language/function-code/block-decl-func-skip-early-err-block.js (default) -annexB/language/function-code/block-decl-func-skip-early-err.js (default) -annexB/language/function-code/block-decl-func-skip-early-err-switch.js (default) -annexB/language/function-code/block-decl-func-skip-early-err-try.js (default) -annexB/language/function-code/if-decl-else-decl-a-func-no-skip-try.js (default) -annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-block.js (default) -annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err.js (default) -annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-switch.js (default) -annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-try.js (default) -annexB/language/function-code/if-decl-else-decl-b-func-no-skip-try.js (default) -annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-block.js (default) -annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err.js (default) -annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-switch.js (default) -annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-try.js (default) -annexB/language/function-code/if-decl-else-stmt-func-no-skip-try.js (default) -annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-block.js (default) -annexB/language/function-code/if-decl-else-stmt-func-skip-early-err.js (default) -annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-switch.js (default) -annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-try.js (default) -annexB/language/function-code/if-decl-no-else-func-no-skip-try.js (default) -annexB/language/function-code/if-decl-no-else-func-skip-early-err-block.js (default) -annexB/language/function-code/if-decl-no-else-func-skip-early-err.js (default) -annexB/language/function-code/if-decl-no-else-func-skip-early-err-switch.js (default) -annexB/language/function-code/if-decl-no-else-func-skip-early-err-try.js (default) -annexB/language/function-code/if-stmt-else-decl-func-no-skip-try.js (default) -annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-block.js (default) -annexB/language/function-code/if-stmt-else-decl-func-skip-early-err.js (default) -annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-switch.js (default) -annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-try.js (default) -annexB/language/function-code/switch-case-func-no-skip-try.js (default) -annexB/language/function-code/switch-case-func-skip-early-err-block.js (default) -annexB/language/function-code/switch-case-func-skip-early-err.js (default) -annexB/language/function-code/switch-case-func-skip-early-err-switch.js (default) -annexB/language/function-code/switch-case-func-skip-early-err-try.js (default) -annexB/language/function-code/switch-dflt-func-no-skip-try.js (default) -annexB/language/function-code/switch-dflt-func-skip-early-err-block.js (default) -annexB/language/function-code/switch-dflt-func-skip-early-err.js (default) -annexB/language/function-code/switch-dflt-func-skip-early-err-switch.js (default) -annexB/language/function-code/switch-dflt-func-skip-early-err-try.js (default) -annexB/language/global-code/block-decl-global-no-skip-try.js (default) -annexB/language/global-code/block-decl-global-skip-early-err-block.js (default) -annexB/language/global-code/block-decl-global-skip-early-err.js (default) -annexB/language/global-code/block-decl-global-skip-early-err-switch.js (default) -annexB/language/global-code/block-decl-global-skip-early-err-try.js (default) -annexB/language/global-code/if-decl-else-decl-a-global-no-skip-try.js (default) -annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-block.js (default) -annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err.js (default) -annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-switch.js (default) -annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-try.js (default) -annexB/language/global-code/if-decl-else-decl-b-global-no-skip-try.js (default) -annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-block.js (default) -annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err.js (default) -annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-switch.js (default) -annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-try.js (default) -annexB/language/global-code/if-decl-else-stmt-global-no-skip-try.js (default) -annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-block.js (default) -annexB/language/global-code/if-decl-else-stmt-global-skip-early-err.js (default) -annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-switch.js (default) -annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-try.js (default) -annexB/language/global-code/if-decl-no-else-global-no-skip-try.js (default) -annexB/language/global-code/if-decl-no-else-global-skip-early-err-block.js (default) -annexB/language/global-code/if-decl-no-else-global-skip-early-err.js (default) -annexB/language/global-code/if-decl-no-else-global-skip-early-err-switch.js (default) -annexB/language/global-code/if-decl-no-else-global-skip-early-err-try.js (default) -annexB/language/global-code/if-stmt-else-decl-global-no-skip-try.js (default) -annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-block.js (default) -annexB/language/global-code/if-stmt-else-decl-global-skip-early-err.js (default) -annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-switch.js (default) -annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-try.js (default) -annexB/language/global-code/switch-case-global-no-skip-try.js (default) -annexB/language/global-code/switch-case-global-skip-early-err-block.js (default) -annexB/language/global-code/switch-case-global-skip-early-err.js (default) -annexB/language/global-code/switch-case-global-skip-early-err-switch.js (default) -annexB/language/global-code/switch-case-global-skip-early-err-try.js (default) -annexB/language/global-code/switch-dflt-global-no-skip-try.js (default) -annexB/language/global-code/switch-dflt-global-skip-early-err-block.js (default) -annexB/language/global-code/switch-dflt-global-skip-early-err.js (default) -annexB/language/global-code/switch-dflt-global-skip-early-err-switch.js (default) -annexB/language/global-code/switch-dflt-global-skip-early-err-try.js (default) -annexB/language/statements/try/catch-redeclared-for-in-var.js (default) -annexB/language/statements/try/catch-redeclared-for-in-var.js (strict mode) -annexB/language/statements/try/catch-redeclared-for-var.js (default) -annexB/language/statements/try/catch-redeclared-for-var.js (strict mode) -annexB/language/statements/try/catch-redeclared-var-statement-captured.js (default) -annexB/language/statements/try/catch-redeclared-var-statement-captured.js (strict mode) -annexB/language/statements/try/catch-redeclared-var-statement.js (default) -annexB/language/statements/try/catch-redeclared-var-statement.js (strict mode) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-function-declaration.js (default) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-class-declaration.js (default) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-function-declaration.js (default) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-generator-declaration.js (default) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-var-declaration.js (default) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-function-declaration.js (default) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-class-declaration.js (default) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-function-declaration.js (default) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-generator-declaration.js (default) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-var-declaration.js (default) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default) -language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-function-declaration.js (default) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-class-declaration.js (default) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-const-declaration.js (default) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-const-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-function-declaration.js (default) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-generator-declaration.js (default) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-let-declaration.js (default) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-let-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-var-declaration.js (default) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-class-declaration.js (default) -language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-function-declaration.js (default) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-class-declaration.js (default) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-generator-declaration.js (default) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration.js (default) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-function-declaration.js (default) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-class-declaration.js (default) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-function-declaration.js (default) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-generator-declaration.js (default) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-var-declaration.js (default) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-class-declaration.js (default) -language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-function-declaration.js (default) -language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-class-declaration.js (default) -language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-function-declaration.js (default) -language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode) -language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-generator-declaration.js (default) -language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode) -language/expressions/async-arrow-function/early-errors-arrow-await-in-formals-default.js (default) -language/expressions/async-arrow-function/early-errors-arrow-await-in-formals-default.js (strict mode) -language/expressions/async-arrow-function/early-errors-arrow-body-contains-super-call.js (default) -language/expressions/async-arrow-function/early-errors-arrow-body-contains-super-call.js (strict mode) -language/expressions/async-arrow-function/early-errors-arrow-body-contains-super-property.js (default) -language/expressions/async-arrow-function/early-errors-arrow-body-contains-super-property.js (strict mode) -language/expressions/async-function/early-errors-expression-body-contains-super-call.js (default) -language/expressions/async-function/early-errors-expression-body-contains-super-call.js (strict mode) -language/expressions/async-function/early-errors-expression-body-contains-super-property.js (default) -language/expressions/async-function/early-errors-expression-body-contains-super-property.js (strict mode) -language/expressions/async-function/early-errors-expression-formals-contains-super-call.js (default) -language/expressions/async-function/early-errors-expression-formals-contains-super-call.js (strict mode) -language/expressions/async-function/early-errors-expression-formals-contains-super-property.js (default) -language/expressions/async-function/early-errors-expression-formals-contains-super-property.js (strict mode) -language/expressions/class/method-param-dflt-yield.js (default) -language/expressions/class/static-method-param-dflt-yield.js (default) -language/expressions/function/early-body-super-call.js (default) -language/expressions/function/early-body-super-call.js (strict mode) -language/expressions/function/early-body-super-prop.js (default) -language/expressions/function/early-body-super-prop.js (strict mode) -language/expressions/function/early-params-super-call.js (default) -language/expressions/function/early-params-super-call.js (strict mode) -language/expressions/function/early-params-super-prop.js (default) -language/expressions/function/early-params-super-prop.js (strict mode) -language/expressions/object/method-definition/early-errors-object-method-body-contains-super-call.js (default) -language/expressions/object/method-definition/early-errors-object-method-body-contains-super-call.js (strict mode) -language/expressions/object/method-definition/early-errors-object-method-duplicate-parameters.js (default) -language/expressions/object/method-definition/early-errors-object-method-formals-contains-super-call.js (default) -language/expressions/object/method-definition/early-errors-object-method-formals-contains-super-call.js (strict mode) -language/expressions/object/method-definition/generator-super-call-body.js (default) -language/expressions/object/method-definition/generator-super-call-body.js (strict mode) -language/expressions/object/method-definition/generator-super-call-param.js (default) -language/expressions/object/method-definition/generator-super-call-param.js (strict mode) -language/expressions/object/prop-def-invalid-async-prefix.js (default) -language/expressions/object/prop-def-invalid-async-prefix.js (strict mode) -language/expressions/yield/in-iteration-stmt.js (default) -language/expressions/yield/in-iteration-stmt.js (strict mode) -language/expressions/yield/star-in-iteration-stmt.js (default) -language/expressions/yield/star-in-iteration-stmt.js (strict mode) -language/global-code/new.target-arrow.js (default) -language/global-code/new.target-arrow.js (strict mode) -language/global-code/super-call-arrow.js (default) -language/global-code/super-call-arrow.js (strict mode) -language/global-code/super-prop-arrow.js (default) -language/global-code/super-prop-arrow.js (strict mode) -language/module-code/early-export-global.js (default) -language/module-code/early-export-global.js (strict mode) -language/module-code/early-export-unresolvable.js (default) -language/module-code/early-export-unresolvable.js (strict mode) -language/statements/async-function/early-errors-declaration-body-contains-super-call.js (default) -language/statements/async-function/early-errors-declaration-body-contains-super-call.js (strict mode) -language/statements/async-function/early-errors-declaration-body-contains-super-property.js (default) -language/statements/async-function/early-errors-declaration-body-contains-super-property.js (strict mode) -language/statements/async-function/early-errors-declaration-formals-contains-super-call.js (default) -language/statements/async-function/early-errors-declaration-formals-contains-super-call.js (strict mode) -language/statements/async-function/early-errors-declaration-formals-contains-super-property.js (default) -language/statements/async-function/early-errors-declaration-formals-contains-super-property.js (strict mode) -language/expressions/async-generator/early-errors-expression-body-contains-super-call.js (default) -language/expressions/async-generator/early-errors-expression-body-contains-super-call.js (strict mode) -language/expressions/async-generator/early-errors-expression-body-contains-super-property.js (default) -language/expressions/async-generator/early-errors-expression-body-contains-super-property.js (strict mode) -language/expressions/async-generator/early-errors-expression-formals-contains-super-call.js (default) -language/expressions/async-generator/early-errors-expression-formals-contains-super-call.js (strict mode) -language/expressions/async-generator/early-errors-expression-formals-contains-super-property.js (default) -language/expressions/async-generator/early-errors-expression-formals-contains-super-property.js (strict mode) -language/statements/class/definition/early-errors-class-method-arguments-in-formal-parameters.js (default) -language/statements/class/definition/early-errors-class-method-body-contains-super-call.js (default) -language/statements/class/definition/early-errors-class-method-body-contains-super-call.js (strict mode) -language/statements/class/definition/early-errors-class-method-duplicate-parameters.js (default) -language/statements/class/definition/early-errors-class-method-eval-in-formal-parameters.js (default) -language/statements/class/definition/early-errors-class-method-formals-contains-super-call.js (default) -language/statements/class/definition/early-errors-class-method-formals-contains-super-call.js (strict mode) -language/statements/class/definition/methods-gen-yield-as-function-expression-binding-identifier.js (default) -language/statements/class/definition/methods-gen-yield-as-identifier-in-nested-function.js (default) -language/statements/class/method-param-yield.js (default) -language/statements/class/static-method-param-yield.js (default) -language/statements/class/strict-mode/with.js (default) -language/statements/class/syntax/early-errors/class-body-has-direct-super-missing-class-heritage.js (default) -language/statements/class/syntax/early-errors/class-body-has-direct-super-missing-class-heritage.js (strict mode) -language/statements/class/syntax/early-errors/class-body-method-contains-direct-super.js (default) -language/statements/class/syntax/early-errors/class-body-method-contains-direct-super.js (strict mode) -language/statements/class/syntax/early-errors/class-body-special-method-generator-contains-direct-super.js (default) -language/statements/class/syntax/early-errors/class-body-special-method-generator-contains-direct-super.js (strict mode) -language/statements/class/syntax/early-errors/class-body-special-method-get-contains-direct-super.js (default) -language/statements/class/syntax/early-errors/class-body-special-method-get-contains-direct-super.js (strict mode) -language/statements/class/syntax/early-errors/class-body-special-method-set-contains-direct-super.js (default) -language/statements/class/syntax/early-errors/class-body-special-method-set-contains-direct-super.js (strict mode) -language/statements/class/syntax/early-errors/class-body-static-method-contains-direct-super.js (default) -language/statements/class/syntax/early-errors/class-body-static-method-contains-direct-super.js (strict mode) -language/statements/class/syntax/early-errors/class-body-static-method-get-contains-direct-super.js (default) -language/statements/class/syntax/early-errors/class-body-static-method-get-contains-direct-super.js (strict mode) -language/statements/class/syntax/early-errors/class-body-static-method-set-contains-direct-super.js (default) -language/statements/class/syntax/early-errors/class-body-static-method-set-contains-direct-super.js (strict mode) -language/statements/class/syntax/early-errors/class-definition-evaluation-block-duplicate-binding.js (default) -language/statements/class/syntax/early-errors/class-definition-evaluation-block-duplicate-binding.js (strict mode) -language/statements/class/syntax/early-errors/class-definition-evaluation-scriptbody-duplicate-binding.js (default) -language/statements/class/syntax/early-errors/class-definition-evaluation-scriptbody-duplicate-binding.js (strict mode) -language/statements/const/syntax/const-declaring-let-split-across-two-lines.js (default) -language/statements/do-while/labelled-fn-stmt.js (default) -language/statements/for/head-let-bound-names-in-stmt.js (default) -language/statements/for/head-let-bound-names-in-stmt.js (strict mode) -language/statements/for-in/head-const-bound-names-in-stmt.js (default) -language/statements/for-in/head-const-bound-names-in-stmt.js (strict mode) -language/statements/for-in/head-const-bound-names-let.js (default) -language/statements/for-in/head-let-bound-names-in-stmt.js (default) -language/statements/for-in/head-let-bound-names-in-stmt.js (strict mode) -language/statements/for-in/head-let-bound-names-let.js (default) -language/statements/for-in/labelled-fn-stmt-const.js (default) -language/statements/for-in/labelled-fn-stmt-let.js (default) -language/statements/for-in/labelled-fn-stmt-lhs.js (default) -language/statements/for-in/labelled-fn-stmt-var.js (default) -language/statements/for-in/let-block-with-newline.js (default) -language/statements/for-in/let-identifier-with-newline.js (default) -language/statements/for/labelled-fn-stmt-expr.js (default) -language/statements/for/labelled-fn-stmt-let.js (default) -language/statements/for/labelled-fn-stmt-var.js (default) -language/statements/for/let-block-with-newline.js (default) -language/statements/for/let-identifier-with-newline.js (default) -language/statements/for-of/head-const-bound-names-in-stmt.js (default) -language/statements/for-of/head-const-bound-names-in-stmt.js (strict mode) -language/statements/for-of/head-const-bound-names-let.js (default) -language/statements/for-of/head-let-bound-names-in-stmt.js (default) -language/statements/for-of/head-let-bound-names-in-stmt.js (strict mode) -language/statements/for-of/head-let-bound-names-let.js (default) -language/statements/for-of/labelled-fn-stmt-const.js (default) -language/statements/for-of/labelled-fn-stmt-let.js (default) -language/statements/for-of/labelled-fn-stmt-lhs.js (default) -language/statements/for-of/labelled-fn-stmt-var.js (default) -language/statements/for-of/let-block-with-newline.js (default) -language/statements/for-of/let-identifier-with-newline.js (default) -language/statements/for-await-of/let-block-with-newline.js (default) -language/statements/for-await-of/let-identifier-with-newline.js (default) -language/statements/function/early-body-super-call.js (default) -language/statements/function/early-body-super-call.js (strict mode) -language/statements/function/early-body-super-prop.js (default) -language/statements/function/early-body-super-prop.js (strict mode) -language/statements/function/early-params-super-call.js (default) -language/statements/function/early-params-super-call.js (strict mode) -language/statements/function/early-params-super-prop.js (default) -language/statements/function/early-params-super-prop.js (strict mode) -language/statements/if/if-gen-else-gen.js (default) -language/statements/if/if-gen-else-stmt.js (default) -language/statements/if/if-gen-no-else.js (default) -language/statements/if/if-stmt-else-gen.js (default) -language/statements/if/labelled-fn-stmt-first.js (default) -language/statements/if/labelled-fn-stmt-lone.js (default) -language/statements/if/labelled-fn-stmt-second.js (default) -language/statements/if/let-block-with-newline.js (default) -language/statements/if/let-identifier-with-newline.js (default) -language/statements/labeled/let-block-with-newline.js (default) -language/statements/labeled/let-identifier-with-newline.js (default) -language/statements/let/syntax/identifier-let-disallowed-as-boundname.js (default) -language/statements/let/syntax/let-let-declaration-split-across-two-lines.js (default) -language/statements/let/syntax/let-let-declaration-with-initializer-split-across-two-lines.js (default) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-function-declaration.js (default) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-class-declaration.js (default) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-function-declaration.js (default) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-generator-declaration.js (default) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-var-declaration.js (default) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-function-declaration.js (default) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-class-declaration.js (default) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-function-declaration.js (default) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-generator-declaration.js (default) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-var-declaration.js (default) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default) -language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-function-declaration.js (default) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-class-declaration.js (default) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-const-declaration.js (default) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-const-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-function-declaration.js (default) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-generator-declaration.js (default) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-let-declaration.js (default) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-let-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-var-declaration.js (default) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-class-declaration.js (default) -language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-function-declaration.js (default) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-class-declaration.js (default) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-generator-declaration.js (default) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration.js (default) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-function-declaration.js (default) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-class-declaration.js (default) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-function-declaration.js (default) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-generator-declaration.js (default) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-var-declaration.js (default) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-class-declaration.js (default) -language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-function-declaration.js (default) -language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-class-declaration.js (default) -language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-function-declaration.js (default) -language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode) -language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-generator-declaration.js (default) -language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode) -language/statements/while/labelled-fn-stmt.js (default) -language/statements/while/let-block-with-newline.js (default) -language/statements/while/let-identifier-with-newline.js (default) -language/statements/with/labelled-fn-stmt.js (default) -language/statements/with/let-block-with-newline.js (default) -language/statements/with/let-identifier-with-newline.js (default) -language/white-space/mongolian-vowel-separator.js (default) -language/white-space/mongolian-vowel-separator.js (strict mode) diff --git a/tools/node_modules/eslint/node_modules/acorn/dist/.keep b/tools/node_modules/eslint/node_modules/acorn/dist/.keep deleted file mode 100644 index e69de29bb2d1d6..00000000000000 diff --git a/tools/node_modules/eslint/node_modules/acorn/dist/acorn.d.ts b/tools/node_modules/eslint/node_modules/acorn/dist/acorn.d.ts new file mode 100644 index 00000000000000..1c8d927d6ecc8c --- /dev/null +++ b/tools/node_modules/eslint/node_modules/acorn/dist/acorn.d.ts @@ -0,0 +1,208 @@ +export as namespace acorn +export = acorn + +declare namespace acorn { + function parse(input: string, options?: Options): Node + + function parseExpressionAt(input: string, pos?: number, options?: Options): Node + + function tokenizer(input: string, options?: Options): { + getToken(): Token + [Symbol.iterator](): Iterator + } + + interface Options { + ecmaVersion?: 3 | 5 | 6 | 7 | 8 | 9 | 10 | 2015 | 2016 | 2017 | 2018 | 2019 + sourceType?: 'script' | 'module' + onInsertedSemicolon?: (lastTokEnd: number, lastTokEndLoc?: Position) => void + onTrailingComma?: (lastTokEnd: number, lastTokEndLoc?: Position) => void + allowReserved?: boolean + allowReturnOutsideFunction?: boolean + allowImportExportEverywhere?: boolean + allowHashBang?: boolean + locations?: boolean + onToken?: ((token: Token) => any) | Token[] + onComment?: (( + isBlock: boolean, text: string, start: number, end: number, startLoc?: Position, + endLoc?: Position + ) => void) | Comment[] + ranges?: boolean + program?: Node + sourceFile?: string + directSourceFile?: string + preserveParens?: boolean + } + + class Parser { + constructor(options: Options, input: string, startPos?: number) + parse(): Node + static parse(input: string, options?: Options): Node + static parseExpressionAt(input: string, pos: number, options?: Options): Node + static tokenizer(input: string, options?: Options): { + getToken(): Token + [Symbol.iterator](): Iterator + } + static extend(...plugins: (typeof Parser)[]): typeof Parser + } + + interface Position { line: number; column: number; offset: number } + + const defaultOptions: Options + + function getLineInfo(input: string, offset: number): Position + + class SourceLocation { + start: Position + end: Position + source?: string | null + constructor(p: Parser, start: Position, end: Position) + } + + class Node { + type: string + start: number + end: number + loc?: SourceLocation + sourceFile?: string + range?: [number, number] + constructor(parser: Parser, pos: number, loc?: SourceLocation) + } + + class TokenType { + label: string + keyword: string + beforeExpr: boolean + startsExpr: boolean + isLoop: boolean + isAssign: boolean + prefix: boolean + postfix: boolean + binop: number + updateContext?: (prevType: TokenType) => void + constructor(label: string, conf?: any) + } + + const tokTypes: { + num: TokenType + regexp: TokenType + string: TokenType + name: TokenType + eof: TokenType + bracketL: TokenType + bracketR: TokenType + braceL: TokenType + braceR: TokenType + parenL: TokenType + parenR: TokenType + comma: TokenType + semi: TokenType + colon: TokenType + dot: TokenType + question: TokenType + arrow: TokenType + template: TokenType + ellipsis: TokenType + backQuote: TokenType + dollarBraceL: TokenType + eq: TokenType + assign: TokenType + incDec: TokenType + prefix: TokenType + logicalOR: TokenType + logicalAND: TokenType + bitwiseOR: TokenType + bitwiseXOR: TokenType + bitwiseAND: TokenType + equality: TokenType + relational: TokenType + bitShift: TokenType + plusMin: TokenType + modulo: TokenType + star: TokenType + slash: TokenType + starstar: TokenType + _break: TokenType + _case: TokenType + _catch: TokenType + _continue: TokenType + _debugger: TokenType + _default: TokenType + _do: TokenType + _else: TokenType + _finally: TokenType + _for: TokenType + _function: TokenType + _if: TokenType + _return: TokenType + _switch: TokenType + _throw: TokenType + _try: TokenType + _var: TokenType + _const: TokenType + _while: TokenType + _with: TokenType + _new: TokenType + _this: TokenType + _super: TokenType + _class: TokenType + _extends: TokenType + _export: TokenType + _import: TokenType + _null: TokenType + _true: TokenType + _false: TokenType + _in: TokenType + _instanceof: TokenType + _typeof: TokenType + _void: TokenType + _delete: TokenType + } + + class TokContext { + constructor(token: string, isExpr: boolean, preserveSpace: boolean, override?: (p: Parser) => void) + } + + const tokContexts: { + b_stat: TokContext + b_expr: TokContext + b_tmpl: TokContext + p_stat: TokContext + p_expr: TokContext + q_tmpl: TokContext + f_expr: TokContext + } + + function isIdentifierStart(code: number, astral?: boolean): boolean + + function isIdentifierChar(code: number, astral?: boolean): boolean + + interface AbstractToken { + } + + interface Comment extends AbstractToken { + type: string + value: string + start: number + end: number + loc?: SourceLocation + range?: [number, number] + } + + class Token { + type: TokenType + value: any + start: number + end: number + loc?: SourceLocation + range?: [number, number] + constructor(p: Parser) + } + + function isNewLine(code: number): boolean + + const lineBreak: RegExp + + const lineBreakG: RegExp + + const version: string +} 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 dada6a37a56339..922ff0c9fc9c1b 100644 --- a/tools/node_modules/eslint/node_modules/acorn/dist/acorn.js +++ b/tools/node_modules/eslint/node_modules/acorn/dist/acorn.js @@ -313,11 +313,12 @@ function getLineInfo(input, offset) { // the parser process. These options are recognized: var defaultOptions = { - // `ecmaVersion` indicates the ECMAScript version to parse. Must - // be either 3, 5, 6 (2015), 7 (2016), or 8 (2017). This influences support - // for strict mode, the set of reserved words, and support for - // new syntax features. The default is 7. - ecmaVersion: 7, + // `ecmaVersion` indicates the ECMAScript version to parse. Must be + // either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), or 10 + // (2019). This influences support for strict mode, the set of + // reserved words, and support for new syntax features. The default + // is 9. + ecmaVersion: 9, // `sourceType` indicates the mode the code should be parsed in. // Can be either `"script"` or `"module"`. This influences global // strict mode and parsing of `import` and `export` declarations. @@ -393,8 +394,7 @@ var defaultOptions = { directSourceFile: null, // When enabled, parenthesized expressions are represented by // (non-standard) ParenthesizedExpression nodes - preserveParens: false, - plugins: {} + preserveParens: false }; // Interpret and default an options object @@ -437,8 +437,26 @@ function pushComment(options, array) { } } -// Registered plugins -var plugins = {}; +// Each scope gets a bitset that may contain these flags +var SCOPE_TOP = 1; +var SCOPE_FUNCTION = 2; +var SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION; +var SCOPE_ASYNC = 4; +var SCOPE_GENERATOR = 8; +var SCOPE_ARROW = 16; +var SCOPE_SIMPLE_CATCH = 32; + +function functionFlags(async, generator) { + return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0) +} + +// Used in checkLVal and declareName to determine the type of a binding +var BIND_NONE = 0; +var BIND_VAR = 1; +var BIND_LEXICAL = 2; +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, "|") + ")$") @@ -465,9 +483,6 @@ var Parser = function Parser(options, input, startPos) { // escape sequences must not be interpreted as keywords. this.containsEsc = false; - // Load plugins - this.loadPlugins(options.plugins); - // Set up token state // The current position of the tokenizer in the input. @@ -508,8 +523,6 @@ var Parser = function Parser(options, input, startPos) { // Used to signify the start of a potential arrow function this.potentialArrowAt = -1; - // Flags to track whether we are in a function, a generator, an async function. - this.inFunction = this.inGenerator = this.inAsync = false; // Positions to delayed-check that yield/await does not exist in default parameters. this.yieldPos = this.awaitPos = 0; // Labels in scope. @@ -521,36 +534,49 @@ var Parser = function Parser(options, input, startPos) { // Scope tracking for duplicate variable names (see scope.js) this.scopeStack = []; - this.enterFunctionScope(); + this.enterScope(SCOPE_TOP); // For RegExp validation this.regexpState = null; }; -// DEPRECATED Kept for backwards compatibility until 3.0 in case a plugin uses them -Parser.prototype.isKeyword = function isKeyword (word) { return this.keywords.test(word) }; -Parser.prototype.isReservedWord = function isReservedWord (word) { return this.reservedWords.test(word) }; +var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true } }; -Parser.prototype.extend = function extend (name, f) { - this[name] = f(this[name]); +Parser.prototype.parse = function parse () { + var node = this.options.program || this.startNode(); + this.nextToken(); + return this.parseTopLevel(node) }; -Parser.prototype.loadPlugins = function loadPlugins (pluginConfigs) { - var this$1 = this; +prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 }; +prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 }; +prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 }; - for (var name in pluginConfigs) { - var plugin = plugins[name]; - if (!plugin) { throw new Error("Plugin '" + name + "' not found") } - plugin(this$1, pluginConfigs[name]); - } +Parser.extend = function extend () { + var plugins = [], len = arguments.length; + while ( len-- ) plugins[ len ] = arguments[ len ]; + + var cls = this; + for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); } + return cls }; -Parser.prototype.parse = function parse () { - var node = this.options.program || this.startNode(); - this.nextToken(); - return this.parseTopLevel(node) +Parser.parse = function parse (input, options) { + return new this(options, input).parse() +}; + +Parser.parseExpressionAt = function parseExpressionAt (input, pos, options) { + var parser = new this(options, input, pos); + parser.nextToken(); + return parser.parseExpression() }; +Parser.tokenizer = function tokenizer (input, options) { + return new this(options, input) +}; + +Object.defineProperties( Parser.prototype, prototypeAccessors ); + var pp = Parser.prototype; // ## Parser utilities @@ -703,7 +729,7 @@ pp$1.parseTopLevel = function(node) { var exports = {}; if (!node.body) { node.body = []; } while (this.type !== types.eof) { - var stmt = this$1.parseStatement(true, true, exports); + var stmt = this$1.parseStatement(null, true, exports); node.body.push(stmt); } this.adaptDirectivePrologue(node.body); @@ -754,7 +780,7 @@ pp$1.isAsyncFunction = function() { // `if (foo) /blah/.exec(foo)`, where looking at the previous token // does not help. -pp$1.parseStatement = function(declaration, topLevel, exports) { +pp$1.parseStatement = function(context, topLevel, exports) { var starttype = this.type, node = this.startNode(), kind; if (this.isLet()) { @@ -772,10 +798,10 @@ pp$1.parseStatement = function(declaration, topLevel, exports) { case types._do: return this.parseDoStatement(node) case types._for: return this.parseForStatement(node) case types._function: - if (!declaration && this.options.ecmaVersion >= 6) { this.unexpected(); } - return this.parseFunctionStatement(node, false) + if ((context && (this.strict || context !== "if")) && this.options.ecmaVersion >= 6) { this.unexpected(); } + return this.parseFunctionStatement(node, false, !context) case types._class: - if (!declaration) { this.unexpected(); } + if (context) { this.unexpected(); } return this.parseClass(node, true) case types._if: return this.parseIfStatement(node) case types._return: return this.parseReturnStatement(node) @@ -784,11 +810,11 @@ pp$1.parseStatement = function(declaration, topLevel, exports) { case types._try: return this.parseTryStatement(node) case types._const: case types._var: kind = kind || this.value; - if (!declaration && kind !== "var") { this.unexpected(); } + if (context && kind !== "var") { this.unexpected(); } return this.parseVarStatement(node, kind) case types._while: return this.parseWhileStatement(node) case types._with: return this.parseWithStatement(node) - case types.braceL: return this.parseBlock() + case types.braceL: return this.parseBlock(true, node) case types.semi: return this.parseEmptyStatement(node) case types._export: case types._import: @@ -807,14 +833,14 @@ pp$1.parseStatement = function(declaration, topLevel, exports) { // Identifier node, we switch to interpreting it as a label. default: if (this.isAsyncFunction()) { - if (!declaration) { this.unexpected(); } + if (context) { this.unexpected(); } this.next(); - return this.parseFunctionStatement(node, true) + return this.parseFunctionStatement(node, true, !context) } var maybeName = this.value, expr = this.parseExpression(); if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon)) - { return this.parseLabeledStatement(node, maybeName, expr) } + { return this.parseLabeledStatement(node, maybeName, expr, context) } else { return this.parseExpressionStatement(node, expr) } } }; @@ -854,7 +880,7 @@ pp$1.parseDebuggerStatement = function(node) { pp$1.parseDoStatement = function(node) { this.next(); this.labels.push(loopLabel); - node.body = this.parseStatement(false); + node.body = this.parseStatement("do"); this.labels.pop(); this.expect(types._while); node.test = this.parseParenExpression(); @@ -877,7 +903,7 @@ pp$1.parseForStatement = function(node) { this.next(); var awaitAt = (this.options.ecmaVersion >= 9 && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction)) && this.eatContextual("await")) ? this.lastTokStart : -1; this.labels.push(loopLabel); - this.enterLexicalScope(); + this.enterScope(0); this.expect(types.parenL); if (this.type === types.semi) { if (awaitAt > -1) { this.unexpected(awaitAt); } @@ -919,17 +945,17 @@ pp$1.parseForStatement = function(node) { return this.parseFor(node, init) }; -pp$1.parseFunctionStatement = function(node, isAsync) { +pp$1.parseFunctionStatement = function(node, isAsync, declarationPosition) { this.next(); - return this.parseFunction(node, true, false, isAsync) + return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync) }; pp$1.parseIfStatement = function(node) { this.next(); node.test = this.parseParenExpression(); // allow function declarations in branches, but only in non-strict mode - node.consequent = this.parseStatement(!this.strict && this.type === types._function); - node.alternate = this.eat(types._else) ? this.parseStatement(!this.strict && this.type === types._function) : null; + node.consequent = this.parseStatement("if"); + node.alternate = this.eat(types._else) ? this.parseStatement("if") : null; return this.finishNode(node, "IfStatement") }; @@ -955,7 +981,7 @@ pp$1.parseSwitchStatement = function(node) { node.cases = []; this.expect(types.braceL); this.labels.push(switchLabel); - this.enterLexicalScope(); + this.enterScope(0); // Statements under must be grouped (by label) in SwitchCase // nodes. `cur` is used to keep the node that we are currently @@ -979,10 +1005,10 @@ pp$1.parseSwitchStatement = function(node) { this$1.expect(types.colon); } else { if (!cur) { this$1.unexpected(); } - cur.consequent.push(this$1.parseStatement(true)); + cur.consequent.push(this$1.parseStatement(null)); } } - this.exitLexicalScope(); + this.exitScope(); if (cur) { this.finishNode(cur, "SwitchCase"); } this.next(); // Closing brace this.labels.pop(); @@ -1011,16 +1037,17 @@ pp$1.parseTryStatement = function(node) { this.next(); if (this.eat(types.parenL)) { clause.param = this.parseBindingAtom(); - this.enterLexicalScope(); - this.checkLVal(clause.param, "let"); + var simple = clause.param.type === "Identifier"; + this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); + this.checkLVal(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); this.expect(types.parenR); } else { if (this.options.ecmaVersion < 10) { this.unexpected(); } clause.param = null; - this.enterLexicalScope(); + this.enterScope(0); } clause.body = this.parseBlock(false); - this.exitLexicalScope(); + this.exitScope(); node.handler = this.finishNode(clause, "CatchClause"); } node.finalizer = this.eat(types._finally) ? this.parseBlock() : null; @@ -1040,7 +1067,7 @@ pp$1.parseWhileStatement = function(node) { this.next(); node.test = this.parseParenExpression(); this.labels.push(loopLabel); - node.body = this.parseStatement(false); + node.body = this.parseStatement("while"); this.labels.pop(); return this.finishNode(node, "WhileStatement") }; @@ -1049,7 +1076,7 @@ pp$1.parseWithStatement = function(node) { if (this.strict) { this.raise(this.start, "'with' in strict mode"); } this.next(); node.object = this.parseParenExpression(); - node.body = this.parseStatement(false); + node.body = this.parseStatement("with"); return this.finishNode(node, "WithStatement") }; @@ -1058,7 +1085,7 @@ pp$1.parseEmptyStatement = function(node) { return this.finishNode(node, "EmptyStatement") }; -pp$1.parseLabeledStatement = function(node, maybeName, expr) { +pp$1.parseLabeledStatement = function(node, maybeName, expr, context) { var this$1 = this; for (var i$1 = 0, list = this$1.labels; i$1 < list.length; i$1 += 1) @@ -1078,7 +1105,7 @@ pp$1.parseLabeledStatement = function(node, maybeName, expr) { } else { break } } this.labels.push({name: maybeName, kind: kind, statementStart: this.start}); - node.body = this.parseStatement(true); + node.body = this.parseStatement(context); if (node.body.type === "ClassDeclaration" || node.body.type === "VariableDeclaration" && node.body.kind !== "var" || node.body.type === "FunctionDeclaration" && (this.strict || node.body.generator || node.body.async)) @@ -1098,23 +1125,19 @@ pp$1.parseExpressionStatement = function(node, expr) { // strict"` declarations when `allowStrict` is true (used for // function bodies). -pp$1.parseBlock = function(createNewLexicalScope) { +pp$1.parseBlock = function(createNewLexicalScope, node) { var this$1 = this; if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true; + if ( node === void 0 ) node = this.startNode(); - var node = this.startNode(); node.body = []; this.expect(types.braceL); - if (createNewLexicalScope) { - this.enterLexicalScope(); - } + if (createNewLexicalScope) { this.enterScope(0); } while (!this.eat(types.braceR)) { - var stmt = this$1.parseStatement(true); + var stmt = this$1.parseStatement(null); node.body.push(stmt); } - if (createNewLexicalScope) { - this.exitLexicalScope(); - } + if (createNewLexicalScope) { this.exitScope(); } return this.finishNode(node, "BlockStatement") }; @@ -1129,8 +1152,8 @@ pp$1.parseFor = function(node, init) { this.expect(types.semi); node.update = this.type === types.parenR ? null : this.parseExpression(); this.expect(types.parenR); - this.exitLexicalScope(); - node.body = this.parseStatement(false); + this.exitScope(); + node.body = this.parseStatement("for"); this.labels.pop(); return this.finishNode(node, "ForStatement") }; @@ -1150,8 +1173,8 @@ pp$1.parseForIn = function(node, init) { node.left = init; node.right = type === "ForInStatement" ? this.parseExpression() : this.parseMaybeAssign(); this.expect(types.parenR); - this.exitLexicalScope(); - node.body = this.parseStatement(false); + this.exitScope(); + node.body = this.parseStatement("for"); this.labels.pop(); return this.finishNode(node, type) }; @@ -1183,47 +1206,43 @@ pp$1.parseVar = function(node, isFor, kind) { pp$1.parseVarId = function(decl, kind) { decl.id = this.parseBindingAtom(kind); - this.checkLVal(decl.id, kind, false); + this.checkLVal(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); }; +var FUNC_STATEMENT = 1; +var FUNC_HANGING_STATEMENT = 2; +var FUNC_NULLABLE_ID = 4; + // Parse a function declaration or literal (depending on the // `isStatement` parameter). -pp$1.parseFunction = function(node, isStatement, allowExpressionBody, isAsync) { +pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync) { this.initFunction(node); if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { node.generator = this.eat(types.star); } if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } - if (isStatement) { - node.id = isStatement === "nullableID" && this.type !== types.name ? null : this.parseIdent(); - if (node.id) { - this.checkLVal(node.id, this.inModule && !this.inFunction ? "let" : "var"); - } + if (statement & FUNC_STATEMENT) { + node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types.name ? null : this.parseIdent(); + if (node.id && !(statement & FUNC_HANGING_STATEMENT)) + { this.checkLVal(node.id, this.inModule && !this.inFunction ? BIND_LEXICAL : BIND_FUNCTION); } } - var oldInGen = this.inGenerator, oldInAsync = this.inAsync, - oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldInFunc = this.inFunction; - this.inGenerator = node.generator; - this.inAsync = node.async; + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos; this.yieldPos = 0; this.awaitPos = 0; - this.inFunction = true; - this.enterFunctionScope(); + this.enterScope(functionFlags(node.async, node.generator)); - if (!isStatement) + if (!(statement & FUNC_STATEMENT)) { node.id = this.type === types.name ? this.parseIdent() : null; } this.parseFunctionParams(node); this.parseFunctionBody(node, allowExpressionBody); - this.inGenerator = oldInGen; - this.inAsync = oldInAsync; this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; - this.inFunction = oldInFunc; - return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression") + return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression") }; pp$1.parseFunctionParams = function(node) { @@ -1247,17 +1266,20 @@ pp$1.parseClass = function(node, isStatement) { classBody.body = []; this.expect(types.braceL); while (!this.eat(types.braceR)) { - var member = this$1.parseClassMember(classBody); - if (member && member.type === "MethodDefinition" && member.kind === "constructor") { - if (hadConstructor) { this$1.raise(member.start, "Duplicate constructor in the same class"); } - hadConstructor = true; + var element = this$1.parseClassElement(); + if (element) { + classBody.body.push(element); + if (element.type === "MethodDefinition" && element.kind === "constructor") { + if (hadConstructor) { this$1.raise(element.start, "Duplicate constructor in the same class"); } + hadConstructor = true; + } } } node.body = this.finishNode(classBody, "ClassBody"); return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression") }; -pp$1.parseClassMember = function(classBody) { +pp$1.parseClassElement = function() { var this$1 = this; if (this.eat(types.semi)) { return null } @@ -1302,7 +1324,7 @@ pp$1.parseClassMember = function(classBody) { } else if (method.static && key.type === "Identifier" && key.name === "prototype") { this.raise(key.start, "Classes may not have a static property named prototype"); } - this.parseClassMethod(classBody, method, isGenerator, isAsync); + this.parseClassMethod(method, isGenerator, isAsync); if (method.kind === "get" && method.value.params.length !== 0) { this.raiseRecoverable(method.value.start, "getter should have no params"); } if (method.kind === "set" && method.value.params.length !== 1) @@ -1312,9 +1334,9 @@ pp$1.parseClassMember = function(classBody) { return method }; -pp$1.parseClassMethod = function(classBody, method, isGenerator, isAsync) { +pp$1.parseClassMethod = function(method, isGenerator, isAsync) { method.value = this.parseMethod(isGenerator, isAsync); - classBody.body.push(this.finishNode(method, "MethodDefinition")); + return this.finishNode(method, "MethodDefinition") }; pp$1.parseClassId = function(node, isStatement) { @@ -1346,7 +1368,7 @@ pp$1.parseExport = function(node, exports) { var fNode = this.startNode(); this.next(); if (isAsync) { this.next(); } - node.declaration = this.parseFunction(fNode, "nullableID", false, isAsync); + node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync, true); } else if (this.type === types._class) { var cNode = this.startNode(); node.declaration = this.parseClass(cNode, "nullableID"); @@ -1358,7 +1380,7 @@ pp$1.parseExport = function(node, exports) { } // export var|const|let|function|class ... if (this.shouldParseExportStatement()) { - node.declaration = this.parseStatement(true); + node.declaration = this.parseStatement(null); if (node.declaration.type === "VariableDeclaration") { this.checkVariableExport(exports, node.declaration.declarations); } else @@ -1493,7 +1515,7 @@ pp$1.parseImportSpecifiers = function() { // import defaultObj, { x, y as z } from '...' var node = this.startNode(); node.local = this.parseIdent(); - this.checkLVal(node.local, "let"); + this.checkLVal(node.local, BIND_LEXICAL); nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); if (!this.eat(types.comma)) { return nodes } } @@ -1502,7 +1524,7 @@ pp$1.parseImportSpecifiers = function() { this.next(); this.expectContextual("as"); node$1.local = this.parseIdent(); - this.checkLVal(node$1.local, "let"); + this.checkLVal(node$1.local, BIND_LEXICAL); nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")); return nodes } @@ -1521,7 +1543,7 @@ pp$1.parseImportSpecifiers = function() { this$1.checkUnreserved(node$2.imported); node$2.local = node$2.imported; } - this$1.checkLVal(node$2.local, "let"); + this$1.checkLVal(node$2.local, BIND_LEXICAL); nodes.push(this$1.finishNode(node$2, "ImportSpecifier")); } return nodes @@ -1736,6 +1758,7 @@ pp$2.parseMaybeDefault = function(startPos, startLoc, left) { pp$2.checkLVal = function(expr, bindingType, checkClashes) { var this$1 = this; + if ( bindingType === void 0 ) bindingType = BIND_NONE; switch (expr.type) { case "Identifier": @@ -1746,19 +1769,7 @@ pp$2.checkLVal = function(expr, bindingType, checkClashes) { { this.raiseRecoverable(expr.start, "Argument name clash"); } checkClashes[expr.name] = true; } - if (bindingType && bindingType !== "none") { - if ( - bindingType === "var" && !this.canDeclareVarName(expr.name) || - bindingType !== "var" && !this.canDeclareLexicalName(expr.name) - ) { - this.raiseRecoverable(expr.start, ("Identifier '" + (expr.name) + "' has already been declared")); - } - if (bindingType === "var") { - this.declareVarName(expr.name); - } else { - this.declareLexicalName(expr.name); - } - } + if (bindingType !== BIND_NONE && bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); } break case "MemberExpression": @@ -1907,13 +1918,19 @@ pp$3.parseExpression = function(noIn, refDestructuringErrors) { // operators like `+=`. pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) { - if (this.inGenerator && this.isContextual("yield")) { return this.parseYield() } + if (this.isContextual("yield")) { + if (this.inGenerator) { return this.parseYield() } + // The tokenizer will assume an expression is allowed after + // `yield`, but this isn't that kind of yield + else { this.exprAllowed = false; } + } - var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1; + var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldShorthandAssign = -1; if (refDestructuringErrors) { oldParenAssign = refDestructuringErrors.parenthesizedAssign; oldTrailingComma = refDestructuringErrors.trailingComma; - refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; + oldShorthandAssign = refDestructuringErrors.shorthandAssign; + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.shorthandAssign = -1; } else { refDestructuringErrors = new DestructuringErrors; ownDestructuringErrors = true; @@ -1939,6 +1956,7 @@ pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) { } if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; } if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; } + if (oldShorthandAssign > -1) { refDestructuringErrors.shorthandAssign = oldShorthandAssign; } return left }; @@ -2130,7 +2148,7 @@ pp$3.parseExprAtom = function(refDestructuringErrors) { var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; var id = this.parseIdent(this.type !== types.name); if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function)) - { return this.parseFunction(this.startNodeAt(startPos, startLoc), false, false, true) } + { 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) } @@ -2181,7 +2199,7 @@ pp$3.parseExprAtom = function(refDestructuringErrors) { case types._function: node = this.startNode(); this.next(); - return this.parseFunction(node, false) + return this.parseFunction(node, 0) case types._class: return this.parseClass(this.startNode(), false) @@ -2300,7 +2318,7 @@ pp$3.parseNew = function() { node.property = this.parseIdent(true); if (node.property.name !== "target" || containsEsc) { this.raiseRecoverable(node.property.start, "The only valid meta property for new is new.target"); } - if (!this.inFunction) + if (!this.inNonArrowFunction()) { this.raiseRecoverable(node.start, "new.target can only be used in functions"); } return this.finishNode(node, "MetaProperty") } @@ -2500,19 +2518,14 @@ pp$3.parsePropertyName = function(prop) { pp$3.initFunction = function(node) { node.id = null; - if (this.options.ecmaVersion >= 6) { - node.generator = false; - node.expression = false; - } - if (this.options.ecmaVersion >= 8) - { node.async = false; } + if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; } + if (this.options.ecmaVersion >= 8) { node.async = false; } }; // Parse object or class method. pp$3.parseMethod = function(isGenerator, isAsync) { - var node = this.startNode(), oldInGen = this.inGenerator, oldInAsync = this.inAsync, - oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldInFunc = this.inFunction; + var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos; this.initFunction(node); if (this.options.ecmaVersion >= 6) @@ -2520,51 +2533,37 @@ pp$3.parseMethod = function(isGenerator, isAsync) { if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } - this.inGenerator = node.generator; - this.inAsync = node.async; this.yieldPos = 0; this.awaitPos = 0; - this.inFunction = true; - this.enterFunctionScope(); + this.enterScope(functionFlags(isAsync, node.generator)); this.expect(types.parenL); node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); this.checkYieldAwaitInDefaultParams(); this.parseFunctionBody(node, false); - this.inGenerator = oldInGen; - this.inAsync = oldInAsync; this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; - this.inFunction = oldInFunc; return this.finishNode(node, "FunctionExpression") }; // Parse arrow function expression with given parameters. pp$3.parseArrowExpression = function(node, params, isAsync) { - var oldInGen = this.inGenerator, oldInAsync = this.inAsync, - oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldInFunc = this.inFunction; + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos; - this.enterFunctionScope(); + this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW); this.initFunction(node); - if (this.options.ecmaVersion >= 8) - { node.async = !!isAsync; } + if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } - this.inGenerator = false; - this.inAsync = node.async; this.yieldPos = 0; this.awaitPos = 0; - this.inFunction = true; node.params = this.toAssignableList(params, true); this.parseFunctionBody(node, true); - this.inGenerator = oldInGen; - this.inAsync = oldInAsync; this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; - this.inFunction = oldInFunc; return this.finishNode(node, "ArrowFunctionExpression") }; @@ -2602,12 +2601,10 @@ pp$3.parseFunctionBody = function(node, isArrowFunction) { this.adaptDirectivePrologue(node.body.body); this.labels = oldLabels; } - this.exitFunctionScope(); + this.exitScope(); - if (this.strict && node.id) { - // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval' - this.checkLVal(node.id, "none"); - } + // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval' + if (this.strict && node.id) { this.checkLVal(node.id, BIND_OUTSIDE); } this.strict = oldStrict; }; @@ -2632,7 +2629,7 @@ pp$3.checkParams = function(node, allowDuplicates) { { var param = list[i]; - this$1.checkLVal(param, "var", allowDuplicates ? null : nameHash); + this$1.checkLVal(param, BIND_VAR, allowDuplicates ? null : nameHash); } }; @@ -2676,7 +2673,7 @@ pp$3.checkUnreserved = function(ref) { { this.raiseRecoverable(start, "Can not 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"); } - if (this.isKeyword(name)) + if (this.keywords.test(name)) { this.raise(start, ("Unexpected keyword '" + name + "'")); } if (this.options.ecmaVersion < 6 && this.input.slice(start, end).indexOf("\\") !== -1) { return } @@ -2769,79 +2766,69 @@ pp$4.curPosition = function() { var pp$5 = Parser.prototype; -// Object.assign polyfill -var assign = Object.assign || function(target) { - var sources = [], len = arguments.length - 1; - while ( len-- > 0 ) sources[ len ] = arguments[ len + 1 ]; - - for (var i = 0, list = sources; i < list.length; i += 1) { - var source = list[i]; - - for (var key in source) { - if (has(source, key)) { - target[key] = source[key]; - } - } - } - return target +var Scope = function Scope(flags) { + this.flags = flags; + // A list of var-declared names in the current lexical scope + this.var = []; + // A list of lexically-declared names in the current lexical scope + this.lexical = []; }; // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names. -pp$5.enterFunctionScope = function() { - // var: a hash of var-declared names in the current lexical scope - // lexical: a hash of lexically-declared names in the current lexical scope - // childVar: a hash of var-declared names in all child lexical scopes of the current lexical scope (within the current function scope) - // parentLexical: a hash of lexically-declared names in all parent lexical scopes of the current lexical scope (within the current function scope) - this.scopeStack.push({var: {}, lexical: {}, childVar: {}, parentLexical: {}}); +pp$5.enterScope = function(flags) { + this.scopeStack.push(new Scope(flags)); }; -pp$5.exitFunctionScope = function() { +pp$5.exitScope = function() { this.scopeStack.pop(); }; -pp$5.enterLexicalScope = function() { - var parentScope = this.scopeStack[this.scopeStack.length - 1]; - var childScope = {var: {}, lexical: {}, childVar: {}, parentLexical: {}}; - - this.scopeStack.push(childScope); - assign(childScope.parentLexical, parentScope.lexical, parentScope.parentLexical); -}; - -pp$5.exitLexicalScope = function() { - var childScope = this.scopeStack.pop(); - var parentScope = this.scopeStack[this.scopeStack.length - 1]; +pp$5.declareName = function(name, bindingType, pos) { + var this$1 = this; - assign(parentScope.childVar, childScope.var, childScope.childVar); + var redeclared = false; + if (bindingType === BIND_LEXICAL) { + var scope = this.currentScope(); + redeclared = scope.lexical.indexOf(name) > -1 || scope.var.indexOf(name) > -1; + scope.lexical.push(name); + } else if (bindingType === BIND_SIMPLE_CATCH) { + var scope$1 = this.currentScope(); + scope$1.lexical.push(name); + } else if (bindingType === BIND_FUNCTION) { + var scope$2 = this.currentScope(); + redeclared = scope$2.lexical.indexOf(name) > -1; + scope$2.var.push(name); + } 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) { redeclared = true; } + scope$3.var.push(name); + if (scope$3.flags & SCOPE_VAR) { break } + } + } + if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); } }; -/** - * A name can be declared with `var` if there are no variables with the same name declared with `let`/`const` - * in the current lexical scope or any of the parent lexical scopes in this function. - */ -pp$5.canDeclareVarName = function(name) { - var currentScope = this.scopeStack[this.scopeStack.length - 1]; - - return !has(currentScope.lexical, name) && !has(currentScope.parentLexical, name) +pp$5.currentScope = function() { + return this.scopeStack[this.scopeStack.length - 1] }; -/** - * A name can be declared with `let`/`const` if there are no variables with the same name declared with `let`/`const` - * in the current scope, and there are no variables with the same name declared with `var` in the current scope or in - * any child lexical scopes in this function. - */ -pp$5.canDeclareLexicalName = function(name) { - var currentScope = this.scopeStack[this.scopeStack.length - 1]; +pp$5.currentVarScope = function() { + var this$1 = this; - return !has(currentScope.lexical, name) && !has(currentScope.var, name) && !has(currentScope.childVar, name) + for (var i = this.scopeStack.length - 1;; i--) { + var scope = this$1.scopeStack[i]; + if (scope.flags & SCOPE_VAR) { return scope } + } }; -pp$5.declareVarName = function(name) { - this.scopeStack[this.scopeStack.length - 1].var[name] = true; -}; +pp$5.inNonArrowFunction = function() { + var this$1 = this; -pp$5.declareLexicalName = function(name) { - this.scopeStack[this.scopeStack.length - 1].lexical[name] = true; + for (var i = this.scopeStack.length - 1; i >= 0; i--) + { if (this$1.scopeStack[i].flags & SCOPE_FUNCTION && !(this$1.scopeStack[i].flags & SCOPE_ARROW)) { return true } } + return false }; var Node = function Node(parser, pos, loc) { @@ -5268,14 +5255,9 @@ pp$8.readWord = function() { // // [ghbt]: https://github.com/acornjs/acorn/issues // -// This file defines the main parser interface. The library also comes -// with a [error-tolerant parser][dammit] and an -// [abstract syntax tree walker][walk], defined in other files. -// -// [dammit]: acorn_loose.js // [walk]: util/walk.js -var version = "5.7.3"; +var version = "6.0.2"; // The main exported interface (under `self.acorn` when in the // browser) is a `parse` function that takes a code string and @@ -5285,7 +5267,7 @@ var version = "5.7.3"; // [api]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API function parse(input, options) { - return new Parser(options, input).parse() + return Parser.parse(input, options) } // This function tries to parse a single expression at a given @@ -5293,35 +5275,21 @@ function parse(input, options) { // that embed JavaScript expressions. function parseExpressionAt(input, pos, options) { - var p = new Parser(options, input, pos); - p.nextToken(); - return p.parseExpression() + return Parser.parseExpressionAt(input, pos, options) } // Acorn is organized as a tokenizer and a recursive-descent parser. // The `tokenizer` export provides an interface to the tokenizer. function tokenizer(input, options) { - return new Parser(options, input) -} - -// This is a terrible kludge to support the existing, pre-ES6 -// interface where the loose parser module retroactively adds exports -// to this module. - // eslint-disable-line camelcase -function addLooseExports(parse, Parser$$1, plugins$$1) { - exports.parse_dammit = parse; // eslint-disable-line camelcase - exports.LooseParser = Parser$$1; - exports.pluginsLoose = plugins$$1; + return Parser.tokenizer(input, options) } exports.version = version; exports.parse = parse; exports.parseExpressionAt = parseExpressionAt; exports.tokenizer = tokenizer; -exports.addLooseExports = addLooseExports; exports.Parser = Parser; -exports.plugins = plugins; exports.defaultOptions = defaultOptions; exports.Position = Position; exports.SourceLocation = SourceLocation; @@ -5343,3 +5311,4 @@ exports.nonASCIIwhitespace = nonASCIIwhitespace; Object.defineProperty(exports, '__esModule', { value: true }); }))); +//# sourceMappingURL=acorn.js.map 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 new file mode 100644 index 00000000000000..57c8681c2eac8e --- /dev/null +++ b/tools/node_modules/eslint/node_modules/acorn/dist/acorn.js.map @@ -0,0 +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 // th 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\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} 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\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 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}\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() {\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 if (nextCh === 91 || nextCh === 123) return true // '{' and '['\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()) {\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 if ((context && (this.strict || context !== \"if\")) && 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)\n if (node.body.type === \"ClassDeclaration\" ||\n node.body.type === \"VariableDeclaration\" && node.body.kind !== \"var\" ||\n node.body.type === \"FunctionDeclaration\" && (this.strict || node.body.generator || node.body.async))\n this.raiseRecoverable(node.body.start, \"Invalid labeled declaration\")\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 this.exitScope()\n node.body = this.parseStatement(\"for\")\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 this.exitScope()\n node.body = this.parseStatement(\"for\")\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 decl.id = this.parseBindingAtom(kind)\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 node.generator = this.eat(tt.star)\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 this.checkLVal(node.id, this.inModule && !this.inFunction ? 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 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()\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 return this.finishNode(node, isStatement ? \"ClassDeclaration\" : \"ClassExpression\")\n}\n\npp.parseClassElement = function() {\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 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 } 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)\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) {\n method.value = this.parseMethod(isGenerator, isAsync)\n return this.finishNode(method, \"MethodDefinition\")\n}\n\npp.parseClassId = function(node, isStatement) {\n node.id = this.type === tt.name ? this.parseIdent() : isStatement === true ? this.unexpected() : null\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)\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, 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()\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 let node, canBeArrow = this.potentialArrowAt === this.start\n switch (this.type) {\n case tt._super:\n if (!this.inFunction)\n this.raise(this.start, \"'super' outside of function or class\")\n node = this.startNode()\n this.next()\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) {\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))\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() {\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()\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_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 }\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\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.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 redeclared = scope.lexical.indexOf(name) > -1\n scope.var.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) redeclared = true\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\npp.inNonArrowFunction = function() {\n for (let i = this.scopeStack.length - 1; i >= 0; i--)\n if (this.scopeStack[i].flags & SCOPE_FUNCTION && !(this.scopeStack[i].flags & SCOPE_ARROW)) return true\n return false\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.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.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 // ` >=1.2.0 <1.3.0 // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 -function replaceTildes(comp, loose) { +function replaceTildes(comp, options) { return comp.trim().split(/\s+/).map(function(comp) { - return replaceTilde(comp, loose); + return replaceTilde(comp, options); }).join(' '); } -function replaceTilde(comp, loose) { - var r = loose ? re[TILDELOOSE] : re[TILDE]; +function replaceTilde(comp, options) { + if (!options || typeof options !== 'object') + options = { loose: !!options, includePrerelease: false } + var r = options.loose ? re[TILDELOOSE] : re[TILDE]; return comp.replace(r, function(_, M, m, p, pr) { debug('tilde', comp, _, M, m, p, pr); var ret; @@ -936,15 +957,17 @@ function replaceTilde(comp, loose) { // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 // ^1.2.3 --> >=1.2.3 <2.0.0 // ^1.2.0 --> >=1.2.0 <2.0.0 -function replaceCarets(comp, loose) { +function replaceCarets(comp, options) { return comp.trim().split(/\s+/).map(function(comp) { - return replaceCaret(comp, loose); + return replaceCaret(comp, options); }).join(' '); } -function replaceCaret(comp, loose) { - debug('caret', comp, loose); - var r = loose ? re[CARETLOOSE] : re[CARET]; +function replaceCaret(comp, options) { + debug('caret', comp, options); + if (!options || typeof options !== 'object') + options = { loose: !!options, includePrerelease: false } + var r = options.loose ? re[CARETLOOSE] : re[CARET]; return comp.replace(r, function(_, M, m, p, pr) { debug('caret', comp, _, M, m, p, pr); var ret; @@ -991,16 +1014,18 @@ function replaceCaret(comp, loose) { }); } -function replaceXRanges(comp, loose) { - debug('replaceXRanges', comp, loose); +function replaceXRanges(comp, options) { + debug('replaceXRanges', comp, options); return comp.split(/\s+/).map(function(comp) { - return replaceXRange(comp, loose); + return replaceXRange(comp, options); }).join(' '); } -function replaceXRange(comp, loose) { +function replaceXRange(comp, options) { comp = comp.trim(); - var r = loose ? re[XRANGELOOSE] : re[XRANGE]; + if (!options || typeof options !== 'object') + options = { loose: !!options, includePrerelease: false } + var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]; return comp.replace(r, function(ret, gtlt, M, m, p, pr) { debug('xRange', comp, ret, gtlt, M, m, p, pr); var xM = isX(M); @@ -1064,8 +1089,8 @@ function replaceXRange(comp, loose) { // Because * is AND-ed with everything else in the comparator, // and '' means "any version", just remove the *s entirely. -function replaceStars(comp, loose) { - debug('replaceStars', comp, loose); +function replaceStars(comp, options) { + debug('replaceStars', comp, options); // Looseness is ignored here. star is always as loose as it gets! return comp.trim().replace(re[STAR], ''); } @@ -1109,22 +1134,25 @@ Range.prototype.test = function(version) { return false; if (typeof version === 'string') - version = new SemVer(version, this.loose); + version = new SemVer(version, this.options); for (var i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version)) + if (testSet(this.set[i], version, this.options)) return true; } return false; }; -function testSet(set, version) { +function testSet(set, version, options) { for (var i = 0; i < set.length; i++) { if (!set[i].test(version)) return false; } - if (version.prerelease.length) { + if (!options) + options = {} + + if (version.prerelease.length && !options.includePrerelease) { // Find the set of versions that are allowed to have prereleases // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 // That should allow `1.2.3-pr.2` to pass. @@ -1152,9 +1180,9 @@ function testSet(set, version) { } exports.satisfies = satisfies; -function satisfies(version, range, loose) { +function satisfies(version, range, options) { try { - range = new Range(range, loose); + range = new Range(range, options); } catch (er) { return false; } @@ -1162,19 +1190,19 @@ function satisfies(version, range, loose) { } exports.maxSatisfying = maxSatisfying; -function maxSatisfying(versions, range, loose) { +function maxSatisfying(versions, range, options) { var max = null; var maxSV = null; try { - var rangeObj = new Range(range, loose); + var rangeObj = new Range(range, options); } catch (er) { return null; } versions.forEach(function (v) { - if (rangeObj.test(v)) { // satisfies(v, range, loose) + if (rangeObj.test(v)) { // satisfies(v, range, options) if (!max || maxSV.compare(v) === -1) { // compare(max, v, true) max = v; - maxSV = new SemVer(max, loose); + maxSV = new SemVer(max, options); } } }) @@ -1182,19 +1210,19 @@ function maxSatisfying(versions, range, loose) { } exports.minSatisfying = minSatisfying; -function minSatisfying(versions, range, loose) { +function minSatisfying(versions, range, options) { var min = null; var minSV = null; try { - var rangeObj = new Range(range, loose); + var rangeObj = new Range(range, options); } catch (er) { return null; } versions.forEach(function (v) { - if (rangeObj.test(v)) { // satisfies(v, range, loose) + if (rangeObj.test(v)) { // satisfies(v, range, options) if (!min || minSV.compare(v) === 1) { // compare(min, v, true) min = v; - minSV = new SemVer(min, loose); + minSV = new SemVer(min, options); } } }) @@ -1202,11 +1230,11 @@ function minSatisfying(versions, range, loose) { } exports.validRange = validRange; -function validRange(range, loose) { +function validRange(range, options) { try { // Return '*' instead of '' so that truthiness works. // This will throw if it's invalid anyway - return new Range(range, loose).range || '*'; + return new Range(range, options).range || '*'; } catch (er) { return null; } @@ -1214,20 +1242,20 @@ function validRange(range, loose) { // Determine if version is less than all the versions possible in the range exports.ltr = ltr; -function ltr(version, range, loose) { - return outside(version, range, '<', loose); +function ltr(version, range, options) { + return outside(version, range, '<', options); } // Determine if version is greater than all the versions possible in the range. exports.gtr = gtr; -function gtr(version, range, loose) { - return outside(version, range, '>', loose); +function gtr(version, range, options) { + return outside(version, range, '>', options); } exports.outside = outside; -function outside(version, range, hilo, loose) { - version = new SemVer(version, loose); - range = new Range(range, loose); +function outside(version, range, hilo, options) { + version = new SemVer(version, options); + range = new Range(range, options); var gtfn, ltefn, ltfn, comp, ecomp; switch (hilo) { @@ -1250,7 +1278,7 @@ function outside(version, range, hilo, loose) { } // If it satisifes the range it is not outside - if (satisfies(version, range, loose)) { + if (satisfies(version, range, options)) { return false; } @@ -1269,9 +1297,9 @@ function outside(version, range, hilo, loose) { } high = high || comparator; low = low || comparator; - if (gtfn(comparator.semver, high.semver, loose)) { + if (gtfn(comparator.semver, high.semver, options)) { high = comparator; - } else if (ltfn(comparator.semver, low.semver, loose)) { + } else if (ltfn(comparator.semver, low.semver, options)) { low = comparator; } }); @@ -1295,15 +1323,15 @@ function outside(version, range, hilo, loose) { } exports.prerelease = prerelease; -function prerelease(version, loose) { - var parsed = parse(version, loose); +function prerelease(version, options) { + var parsed = parse(version, options); return (parsed && parsed.prerelease.length) ? parsed.prerelease : null; } exports.intersects = intersects; -function intersects(r1, r2, loose) { - r1 = new Range(r1, loose) - r2 = new Range(r2, loose) +function intersects(r1, r2, options) { + r1 = new Range(r1, options) + r2 = new Range(r2, options) return r1.intersects(r2) } diff --git a/tools/node_modules/eslint/node_modules/table/LICENSE b/tools/node_modules/eslint/node_modules/table/LICENSE index 7e84ea3afc0677..6c41d45cd765c2 100644 --- a/tools/node_modules/eslint/node_modules/table/LICENSE +++ b/tools/node_modules/eslint/node_modules/table/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2016, Gajus Kuizinas (http://gajus.com/) +Copyright (c) 2018, Gajus Kuizinas (http://gajus.com/) All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/tools/node_modules/eslint/node_modules/table/README.md b/tools/node_modules/eslint/node_modules/table/README.md index 14e3934ea52efe..1e47185c170563 100644 --- a/tools/node_modules/eslint/node_modules/table/README.md +++ b/tools/node_modules/eslint/node_modules/table/README.md @@ -1,9 +1,11 @@ # Table -[![Travis build status](http://img.shields.io/travis/gajus/table/master.svg?style=flat)](https://travis-ci.org/gajus/table) -[![NPM version](http://img.shields.io/npm/v/table.svg?style=flat)](https://www.npmjs.com/package/table) -[![js-canonical-style](https://img.shields.io/badge/code%20style-canonical-brightgreen.svg?style=flat)](https://github.com/gajus/canonical) +[![Travis build status](http://img.shields.io/travis/gajus/table/master.svg?style=flat-square)](https://travis-ci.org/gajus/table) +[![Coveralls](https://img.shields.io/coveralls/gajus/table.svg?style=flat-square)](https://coveralls.io/github/gajus/table) +[![NPM version](http://img.shields.io/npm/v/table.svg?style=flat-square)](https://www.npmjs.org/package/table) +[![Canonical Code Style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical) +[![Twitter Follow](https://img.shields.io/twitter/follow/kuizinas.svg?style=social&label=Follow)](https://twitter.com/kuizinas) * [Table](#table) * [Features](#table-features) @@ -96,7 +98,7 @@ data = [ * Used to dynamically tell table whether to draw a line separating rows or not. * The default behavior is to always return true. * - * @typedef {function} drawJoin + * @typedef {function} drawHorizontalLine * @param {number} index * @param {number} size * @return {boolean} @@ -107,7 +109,7 @@ data = [ * @property {table~border} border * @property {table~columns[]} columns Column specific configuration. * @property {table~columns} columnDefault Default values for all columns. Column specific settings overwrite the default values. - * @property {table~drawJoin} drawHorizontalLine + * @property {table~drawHorizontalLine} drawHorizontalLine */ /** @@ -296,7 +298,7 @@ data = [ options = { /** - * @typedef {function} drawJoin + * @typedef {function} drawHorizontalLine * @param {number} index * @param {number} size * @return {boolean} @@ -309,6 +311,7 @@ options = { output = table(data, options); console.log(output); + ``` ``` @@ -321,6 +324,7 @@ console.log(output); ╟────┼────┼────╢ ║ 4A │ 4B │ 4C ║ ╚════╧════╧════╝ + ``` diff --git a/tools/node_modules/eslint/node_modules/table/dist/alignString.js b/tools/node_modules/eslint/node_modules/table/dist/alignString.js index 3a948d3afd69c7..a599ce8f9b5e1a 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/alignString.js +++ b/tools/node_modules/eslint/node_modules/table/dist/alignString.js @@ -1,58 +1,54 @@ -'use strict'; +"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = void 0; -var _lodash = require('lodash'); +var _lodash = _interopRequireDefault(require("lodash")); -var _lodash2 = _interopRequireDefault(_lodash); - -var _stringWidth = require('string-width'); - -var _stringWidth2 = _interopRequireDefault(_stringWidth); +var _stringWidth = _interopRequireDefault(require("string-width")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const alignments = ['left', 'right', 'center']; - /** * @param {string} subject * @param {number} width * @returns {string} */ + const alignLeft = (subject, width) => { return subject + ' '.repeat(width); }; - /** * @param {string} subject * @param {number} width * @returns {string} */ + + const alignRight = (subject, width) => { return ' '.repeat(width) + subject; }; - /** * @param {string} subject * @param {number} width * @returns {string} */ + + const alignCenter = (subject, width) => { let halfWidth; - halfWidth = width / 2; if (halfWidth % 2 === 0) { return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth); } else { halfWidth = Math.floor(halfWidth); - return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth + 1); } }; - /** * Pads a string to the left and/or right to position the subject * text in a desired alignment within a container. @@ -63,24 +59,24 @@ const alignCenter = (subject, width) => { * @returns {string} */ -exports.default = (subject, containerWidth, alignment) => { - if (!_lodash2.default.isString(subject)) { + +const alignString = (subject, containerWidth, alignment) => { + if (!_lodash.default.isString(subject)) { throw new TypeError('Subject parameter value must be a string.'); } - if (!_lodash2.default.isNumber(containerWidth)) { + if (!_lodash.default.isNumber(containerWidth)) { throw new TypeError('Container width parameter value must be a number.'); } - const subjectWidth = (0, _stringWidth2.default)(subject); + const subjectWidth = (0, _stringWidth.default)(subject); if (subjectWidth > containerWidth) { // console.log('subjectWidth', subjectWidth, 'containerWidth', containerWidth, 'subject', subject); - throw new Error('Subject parameter value width cannot be greater than the container width.'); } - if (!_lodash2.default.isString(alignment)) { + if (!_lodash.default.isString(alignment)) { throw new TypeError('Alignment parameter value must be a string.'); } @@ -103,4 +99,8 @@ exports.default = (subject, containerWidth, alignment) => { } return alignCenter(subject, availableWidth); -}; \ No newline at end of file +}; + +var _default = alignString; +exports.default = _default; +//# sourceMappingURL=alignString.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/alignString.js.flow b/tools/node_modules/eslint/node_modules/table/dist/alignString.js.flow new file mode 100644 index 00000000000000..16936a44c14dcf --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/alignString.js.flow @@ -0,0 +1,96 @@ +import _ from 'lodash'; +import stringWidth from 'string-width'; + +const alignments = [ + 'left', + 'right', + 'center' +]; + +/** + * @param {string} subject + * @param {number} width + * @returns {string} + */ +const alignLeft = (subject, width) => { + return subject + ' '.repeat(width); +}; + +/** + * @param {string} subject + * @param {number} width + * @returns {string} + */ +const alignRight = (subject, width) => { + return ' '.repeat(width) + subject; +}; + +/** + * @param {string} subject + * @param {number} width + * @returns {string} + */ +const alignCenter = (subject, width) => { + let halfWidth; + + halfWidth = width / 2; + + if (halfWidth % 2 === 0) { + return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth); + } else { + halfWidth = Math.floor(halfWidth); + + return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth + 1); + } +}; + +/** + * Pads a string to the left and/or right to position the subject + * text in a desired alignment within a container. + * + * @param {string} subject + * @param {number} containerWidth + * @param {string} alignment One of the valid options (left, right, center). + * @returns {string} + */ +export default (subject, containerWidth, alignment) => { + if (!_.isString(subject)) { + throw new TypeError('Subject parameter value must be a string.'); + } + + if (!_.isNumber(containerWidth)) { + throw new TypeError('Container width parameter value must be a number.'); + } + + const subjectWidth = stringWidth(subject); + + if (subjectWidth > containerWidth) { + // console.log('subjectWidth', subjectWidth, 'containerWidth', containerWidth, 'subject', subject); + + throw new Error('Subject parameter value width cannot be greater than the container width.'); + } + + if (!_.isString(alignment)) { + throw new TypeError('Alignment parameter value must be a string.'); + } + + if (alignments.indexOf(alignment) === -1) { + throw new Error('Alignment parameter value must be a known alignment parameter value (left, right, center).'); + } + + if (subjectWidth === 0) { + return ' '.repeat(containerWidth); + } + + const availableWidth = containerWidth - subjectWidth; + + if (alignment === 'left') { + return alignLeft(subject, availableWidth); + } + + if (alignment === 'right') { + return alignRight(subject, availableWidth); + } + + return alignCenter(subject, availableWidth); +}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/alignString.js.map b/tools/node_modules/eslint/node_modules/table/dist/alignString.js.map new file mode 100644 index 00000000000000..8420a3b3f31543 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/alignString.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/alignString.js"],"names":["alignments","alignLeft","subject","width","repeat","alignRight","alignCenter","halfWidth","Math","floor","containerWidth","alignment","_","isString","TypeError","isNumber","subjectWidth","Error","indexOf","availableWidth"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA,MAAMA,UAAU,GAAG,CACjB,MADiB,EAEjB,OAFiB,EAGjB,QAHiB,CAAnB;AAMA;;;;;;AAKA,MAAMC,SAAS,GAAG,CAACC,OAAD,EAAUC,KAAV,KAAoB;AACpC,SAAOD,OAAO,GAAG,IAAIE,MAAJ,CAAWD,KAAX,CAAjB;AACD,CAFD;AAIA;;;;;;;AAKA,MAAME,UAAU,GAAG,CAACH,OAAD,EAAUC,KAAV,KAAoB;AACrC,SAAO,IAAIC,MAAJ,CAAWD,KAAX,IAAoBD,OAA3B;AACD,CAFD;AAIA;;;;;;;AAKA,MAAMI,WAAW,GAAG,CAACJ,OAAD,EAAUC,KAAV,KAAoB;AACtC,MAAII,SAAJ;AAEAA,EAAAA,SAAS,GAAGJ,KAAK,GAAG,CAApB;;AAEA,MAAII,SAAS,GAAG,CAAZ,KAAkB,CAAtB,EAAyB;AACvB,WAAO,IAAIH,MAAJ,CAAWG,SAAX,IAAwBL,OAAxB,GAAkC,IAAIE,MAAJ,CAAWG,SAAX,CAAzC;AACD,GAFD,MAEO;AACLA,IAAAA,SAAS,GAAGC,IAAI,CAACC,KAAL,CAAWF,SAAX,CAAZ;AAEA,WAAO,IAAIH,MAAJ,CAAWG,SAAX,IAAwBL,OAAxB,GAAkC,IAAIE,MAAJ,CAAWG,SAAS,GAAG,CAAvB,CAAzC;AACD;AACF,CAZD;AAcA;;;;;;;;;;;qBASgBL,O,EAASQ,c,EAAgBC,S,KAAc;AACrD,MAAI,CAACC,gBAAEC,QAAF,CAAWX,OAAX,CAAL,EAA0B;AACxB,UAAM,IAAIY,SAAJ,CAAc,2CAAd,CAAN;AACD;;AAED,MAAI,CAACF,gBAAEG,QAAF,CAAWL,cAAX,CAAL,EAAiC;AAC/B,UAAM,IAAII,SAAJ,CAAc,mDAAd,CAAN;AACD;;AAED,QAAME,YAAY,GAAG,0BAAYd,OAAZ,CAArB;;AAEA,MAAIc,YAAY,GAAGN,cAAnB,EAAmC;AACjC;AAEA,UAAM,IAAIO,KAAJ,CAAU,2EAAV,CAAN;AACD;;AAED,MAAI,CAACL,gBAAEC,QAAF,CAAWF,SAAX,CAAL,EAA4B;AAC1B,UAAM,IAAIG,SAAJ,CAAc,6CAAd,CAAN;AACD;;AAED,MAAId,UAAU,CAACkB,OAAX,CAAmBP,SAAnB,MAAkC,CAAC,CAAvC,EAA0C;AACxC,UAAM,IAAIM,KAAJ,CAAU,4FAAV,CAAN;AACD;;AAED,MAAID,YAAY,KAAK,CAArB,EAAwB;AACtB,WAAO,IAAIZ,MAAJ,CAAWM,cAAX,CAAP;AACD;;AAED,QAAMS,cAAc,GAAGT,cAAc,GAAGM,YAAxC;;AAEA,MAAIL,SAAS,KAAK,MAAlB,EAA0B;AACxB,WAAOV,SAAS,CAACC,OAAD,EAAUiB,cAAV,CAAhB;AACD;;AAED,MAAIR,SAAS,KAAK,OAAlB,EAA2B;AACzB,WAAON,UAAU,CAACH,OAAD,EAAUiB,cAAV,CAAjB;AACD;;AAED,SAAOb,WAAW,CAACJ,OAAD,EAAUiB,cAAV,CAAlB;AACD,C","sourcesContent":["import _ from 'lodash';\nimport stringWidth from 'string-width';\n\nconst alignments = [\n 'left',\n 'right',\n 'center'\n];\n\n/**\n * @param {string} subject\n * @param {number} width\n * @returns {string}\n */\nconst alignLeft = (subject, width) => {\n return subject + ' '.repeat(width);\n};\n\n/**\n * @param {string} subject\n * @param {number} width\n * @returns {string}\n */\nconst alignRight = (subject, width) => {\n return ' '.repeat(width) + subject;\n};\n\n/**\n * @param {string} subject\n * @param {number} width\n * @returns {string}\n */\nconst alignCenter = (subject, width) => {\n let halfWidth;\n\n halfWidth = width / 2;\n\n if (halfWidth % 2 === 0) {\n return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth);\n } else {\n halfWidth = Math.floor(halfWidth);\n\n return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth + 1);\n }\n};\n\n/**\n * Pads a string to the left and/or right to position the subject\n * text in a desired alignment within a container.\n *\n * @param {string} subject\n * @param {number} containerWidth\n * @param {string} alignment One of the valid options (left, right, center).\n * @returns {string}\n */\nexport default (subject, containerWidth, alignment) => {\n if (!_.isString(subject)) {\n throw new TypeError('Subject parameter value must be a string.');\n }\n\n if (!_.isNumber(containerWidth)) {\n throw new TypeError('Container width parameter value must be a number.');\n }\n\n const subjectWidth = stringWidth(subject);\n\n if (subjectWidth > containerWidth) {\n // console.log('subjectWidth', subjectWidth, 'containerWidth', containerWidth, 'subject', subject);\n\n throw new Error('Subject parameter value width cannot be greater than the container width.');\n }\n\n if (!_.isString(alignment)) {\n throw new TypeError('Alignment parameter value must be a string.');\n }\n\n if (alignments.indexOf(alignment) === -1) {\n throw new Error('Alignment parameter value must be a known alignment parameter value (left, right, center).');\n }\n\n if (subjectWidth === 0) {\n return ' '.repeat(containerWidth);\n }\n\n const availableWidth = containerWidth - subjectWidth;\n\n if (alignment === 'left') {\n return alignLeft(subject, availableWidth);\n }\n\n if (alignment === 'right') {\n return alignRight(subject, availableWidth);\n }\n\n return alignCenter(subject, availableWidth);\n};\n"],"file":"alignString.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/alignTableData.js b/tools/node_modules/eslint/node_modules/table/dist/alignTableData.js index eb4078455355d6..e01bd552610836 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/alignTableData.js +++ b/tools/node_modules/eslint/node_modules/table/dist/alignTableData.js @@ -1,16 +1,13 @@ -'use strict'; +"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = void 0; -var _stringWidth = require('string-width'); +var _stringWidth = _interopRequireDefault(require("string-width")); -var _stringWidth2 = _interopRequireDefault(_stringWidth); - -var _alignString = require('./alignString'); - -var _alignString2 = _interopRequireDefault(_alignString); +var _alignString = _interopRequireDefault(require("./alignString")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -19,16 +16,20 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * @param {Object} config * @returns {table~row[]} */ -exports.default = (rows, config) => { +const alignTableData = (rows, config) => { return rows.map(cells => { return cells.map((value, index1) => { const column = config.columns[index1]; - if ((0, _stringWidth2.default)(value) === column.width) { + if ((0, _stringWidth.default)(value) === column.width) { return value; } else { - return (0, _alignString2.default)(value, column.width, column.alignment); + return (0, _alignString.default)(value, column.width, column.alignment); } }); }); -}; \ No newline at end of file +}; + +var _default = alignTableData; +exports.default = _default; +//# sourceMappingURL=alignTableData.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/alignTableData.js.flow b/tools/node_modules/eslint/node_modules/table/dist/alignTableData.js.flow new file mode 100644 index 00000000000000..8a7be7a7e7cf5c --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/alignTableData.js.flow @@ -0,0 +1,21 @@ +import stringWidth from 'string-width'; +import alignString from './alignString'; + +/** + * @param {table~row[]} rows + * @param {Object} config + * @returns {table~row[]} + */ +export default (rows, config) => { + return rows.map((cells) => { + return cells.map((value, index1) => { + const column = config.columns[index1]; + + if (stringWidth(value) === column.width) { + return value; + } else { + return alignString(value, column.width, column.alignment); + } + }); + }); +}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/alignTableData.js.map b/tools/node_modules/eslint/node_modules/table/dist/alignTableData.js.map new file mode 100644 index 00000000000000..183240f8a43d24 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/alignTableData.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/alignTableData.js"],"names":["rows","config","map","cells","value","index1","column","columns","width","alignment"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA;;;;;wBAKgBA,I,EAAMC,M,KAAW;AAC/B,SAAOD,IAAI,CAACE,GAAL,CAAUC,KAAD,IAAW;AACzB,WAAOA,KAAK,CAACD,GAAN,CAAU,CAACE,KAAD,EAAQC,MAAR,KAAmB;AAClC,YAAMC,MAAM,GAAGL,MAAM,CAACM,OAAP,CAAeF,MAAf,CAAf;;AAEA,UAAI,0BAAYD,KAAZ,MAAuBE,MAAM,CAACE,KAAlC,EAAyC;AACvC,eAAOJ,KAAP;AACD,OAFD,MAEO;AACL,eAAO,0BAAYA,KAAZ,EAAmBE,MAAM,CAACE,KAA1B,EAAiCF,MAAM,CAACG,SAAxC,CAAP;AACD;AACF,KARM,CAAP;AASD,GAVM,CAAP;AAWD,C","sourcesContent":["import stringWidth from 'string-width';\nimport alignString from './alignString';\n\n/**\n * @param {table~row[]} rows\n * @param {Object} config\n * @returns {table~row[]}\n */\nexport default (rows, config) => {\n return rows.map((cells) => {\n return cells.map((value, index1) => {\n const column = config.columns[index1];\n\n if (stringWidth(value) === column.width) {\n return value;\n } else {\n return alignString(value, column.width, column.alignment);\n }\n });\n });\n};\n"],"file":"alignTableData.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js b/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js index 7a8973808149b1..2725ee009ea43d 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js +++ b/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js @@ -1,20 +1,15 @@ -'use strict'; +"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = void 0; -var _lodash = require('lodash'); +var _lodash = _interopRequireDefault(require("lodash")); -var _lodash2 = _interopRequireDefault(_lodash); +var _stringWidth = _interopRequireDefault(require("string-width")); -var _stringWidth = require('string-width'); - -var _stringWidth2 = _interopRequireDefault(_stringWidth); - -var _wrapWord = require('./wrapWord'); - -var _wrapWord2 = _interopRequireDefault(_wrapWord); +var _wrapWord = _interopRequireDefault(require("./wrapWord")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -24,10 +19,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * @param {boolean} useWrapWord * @returns {number} */ -exports.default = function (value, columnWidth) { - let useWrapWord = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - if (!_lodash2.default.isString(value)) { +const calculateCellHeight = (value, columnWidth, useWrapWord = false) => { + if (!_lodash.default.isString(value)) { throw new TypeError('Value must be a string.'); } @@ -40,8 +33,12 @@ exports.default = function (value, columnWidth) { } if (useWrapWord) { - return (0, _wrapWord2.default)(value, columnWidth).length; + return (0, _wrapWord.default)(value, columnWidth).length; } - return Math.ceil((0, _stringWidth2.default)(value) / columnWidth); -}; \ No newline at end of file + return Math.ceil((0, _stringWidth.default)(value) / columnWidth); +}; + +var _default = calculateCellHeight; +exports.default = _default; +//# sourceMappingURL=calculateCellHeight.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js.flow b/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js.flow new file mode 100644 index 00000000000000..94afd3742140e1 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js.flow @@ -0,0 +1,29 @@ +import _ from 'lodash'; +import stringWidth from 'string-width'; +import wrapWord from './wrapWord'; + +/** + * @param {string} value + * @param {number} columnWidth + * @param {boolean} useWrapWord + * @returns {number} + */ +export default (value, columnWidth, useWrapWord = false) => { + if (!_.isString(value)) { + throw new TypeError('Value must be a string.'); + } + + if (!Number.isInteger(columnWidth)) { + throw new TypeError('Column width must be an integer.'); + } + + if (columnWidth < 1) { + throw new Error('Column width must be greater than 0.'); + } + + if (useWrapWord) { + return wrapWord(value, columnWidth).length; + } + + return Math.ceil(stringWidth(value) / columnWidth); +}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js.map b/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js.map new file mode 100644 index 00000000000000..43ec44038f1408 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/calculateCellHeight.js"],"names":["value","columnWidth","useWrapWord","_","isString","TypeError","Number","isInteger","Error","length","Math","ceil"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;AAEA;;;;;;6BAMgBA,K,EAAOC,W,EAAaC,WAAW,GAAG,K,KAAU;AAC1D,MAAI,CAACC,gBAAEC,QAAF,CAAWJ,KAAX,CAAL,EAAwB;AACtB,UAAM,IAAIK,SAAJ,CAAc,yBAAd,CAAN;AACD;;AAED,MAAI,CAACC,MAAM,CAACC,SAAP,CAAiBN,WAAjB,CAAL,EAAoC;AAClC,UAAM,IAAII,SAAJ,CAAc,kCAAd,CAAN;AACD;;AAED,MAAIJ,WAAW,GAAG,CAAlB,EAAqB;AACnB,UAAM,IAAIO,KAAJ,CAAU,sCAAV,CAAN;AACD;;AAED,MAAIN,WAAJ,EAAiB;AACf,WAAO,uBAASF,KAAT,EAAgBC,WAAhB,EAA6BQ,MAApC;AACD;;AAED,SAAOC,IAAI,CAACC,IAAL,CAAU,0BAAYX,KAAZ,IAAqBC,WAA/B,CAAP;AACD,C","sourcesContent":["import _ from 'lodash';\nimport stringWidth from 'string-width';\nimport wrapWord from './wrapWord';\n\n/**\n * @param {string} value\n * @param {number} columnWidth\n * @param {boolean} useWrapWord\n * @returns {number}\n */\nexport default (value, columnWidth, useWrapWord = false) => {\n if (!_.isString(value)) {\n throw new TypeError('Value must be a string.');\n }\n\n if (!Number.isInteger(columnWidth)) {\n throw new TypeError('Column width must be an integer.');\n }\n\n if (columnWidth < 1) {\n throw new Error('Column width must be greater than 0.');\n }\n\n if (useWrapWord) {\n return wrapWord(value, columnWidth).length;\n }\n\n return Math.ceil(stringWidth(value) / columnWidth);\n};\n"],"file":"calculateCellHeight.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateCellWidthIndex.js b/tools/node_modules/eslint/node_modules/table/dist/calculateCellWidthIndex.js index e6bf927edb7975..82b406015b8288 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/calculateCellWidthIndex.js +++ b/tools/node_modules/eslint/node_modules/table/dist/calculateCellWidthIndex.js @@ -1,12 +1,11 @@ -'use strict'; +"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = void 0; -var _stringWidth = require('string-width'); - -var _stringWidth2 = _interopRequireDefault(_stringWidth); +var _stringWidth = _interopRequireDefault(require("string-width")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -16,8 +15,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * @param {string[]} cells * @returns {number[]} */ -exports.default = cells => { +const calculateCellWidthIndex = cells => { return cells.map(value => { - return (0, _stringWidth2.default)(value); + return (0, _stringWidth.default)(value); }); -}; \ No newline at end of file +}; + +var _default = calculateCellWidthIndex; +exports.default = _default; +//# sourceMappingURL=calculateCellWidthIndex.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateCellWidthIndex.js.flow b/tools/node_modules/eslint/node_modules/table/dist/calculateCellWidthIndex.js.flow new file mode 100644 index 00000000000000..f6b90dd8c09b89 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/calculateCellWidthIndex.js.flow @@ -0,0 +1,13 @@ +import stringWidth from 'string-width'; + +/** + * Calculates width of each cell contents. + * + * @param {string[]} cells + * @returns {number[]} + */ +export default (cells) => { + return cells.map((value) => { + return stringWidth(value); + }); +}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateCellWidthIndex.js.map b/tools/node_modules/eslint/node_modules/table/dist/calculateCellWidthIndex.js.map new file mode 100644 index 00000000000000..99d1f7798da891 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/calculateCellWidthIndex.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/calculateCellWidthIndex.js"],"names":["cells","map","value"],"mappings":";;;;;;;AAAA;;;;AAEA;;;;;;gCAMgBA,K,IAAU;AACxB,SAAOA,KAAK,CAACC,GAAN,CAAWC,KAAD,IAAW;AAC1B,WAAO,0BAAYA,KAAZ,CAAP;AACD,GAFM,CAAP;AAGD,C","sourcesContent":["import stringWidth from 'string-width';\n\n/**\n * Calculates width of each cell contents.\n *\n * @param {string[]} cells\n * @returns {number[]}\n */\nexport default (cells) => {\n return cells.map((value) => {\n return stringWidth(value);\n });\n};\n"],"file":"calculateCellWidthIndex.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateMaximumColumnWidthIndex.js b/tools/node_modules/eslint/node_modules/table/dist/calculateMaximumColumnWidthIndex.js index da366c1423c79a..ea5d4b9a4bab4d 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/calculateMaximumColumnWidthIndex.js +++ b/tools/node_modules/eslint/node_modules/table/dist/calculateMaximumColumnWidthIndex.js @@ -1,12 +1,11 @@ -'use strict'; +"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = void 0; -var _calculateCellWidthIndex = require('./calculateCellWidthIndex'); - -var _calculateCellWidthIndex2 = _interopRequireDefault(_calculateCellWidthIndex); +var _calculateCellWidthIndex = _interopRequireDefault(require("./calculateCellWidthIndex")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -16,22 +15,23 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * @param {Array[]} rows * @returns {number[]} */ -exports.default = rows => { +const calculateMaximumColumnWidthIndex = rows => { if (!rows[0]) { throw new Error('Dataset must have at least one row.'); } - const columns = Array(rows[0].length).fill(0); - + const columns = new Array(rows[0].length).fill(0); rows.forEach(row => { - const columnWidthIndex = (0, _calculateCellWidthIndex2.default)(row); - + const columnWidthIndex = (0, _calculateCellWidthIndex.default)(row); columnWidthIndex.forEach((valueWidth, index0) => { if (columns[index0] < valueWidth) { columns[index0] = valueWidth; } }); }); - return columns; -}; \ No newline at end of file +}; + +var _default = calculateMaximumColumnWidthIndex; +exports.default = _default; +//# sourceMappingURL=calculateMaximumColumnWidthIndex.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.flow b/tools/node_modules/eslint/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.flow new file mode 100644 index 00000000000000..5c8c10981cc63b --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.flow @@ -0,0 +1,27 @@ +import calculateCellWidthIndex from './calculateCellWidthIndex'; + +/** + * Produces an array of values that describe the largest value length (width) in every column. + * + * @param {Array[]} rows + * @returns {number[]} + */ +export default (rows) => { + if (!rows[0]) { + throw new Error('Dataset must have at least one row.'); + } + + const columns = new Array(rows[0].length).fill(0); + + rows.forEach((row) => { + const columnWidthIndex = calculateCellWidthIndex(row); + + columnWidthIndex.forEach((valueWidth, index0) => { + if (columns[index0] < valueWidth) { + columns[index0] = valueWidth; + } + }); + }); + + return columns; +}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.map b/tools/node_modules/eslint/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.map new file mode 100644 index 00000000000000..c30f4ceecd2782 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/calculateMaximumColumnWidthIndex.js"],"names":["rows","Error","columns","Array","length","fill","forEach","row","columnWidthIndex","valueWidth","index0"],"mappings":";;;;;;;AAAA;;;;AAEA;;;;;;yCAMgBA,I,IAAS;AACvB,MAAI,CAACA,IAAI,CAAC,CAAD,CAAT,EAAc;AACZ,UAAM,IAAIC,KAAJ,CAAU,qCAAV,CAAN;AACD;;AAED,QAAMC,OAAO,GAAG,IAAIC,KAAJ,CAAUH,IAAI,CAAC,CAAD,CAAJ,CAAQI,MAAlB,EAA0BC,IAA1B,CAA+B,CAA/B,CAAhB;AAEAL,EAAAA,IAAI,CAACM,OAAL,CAAcC,GAAD,IAAS;AACpB,UAAMC,gBAAgB,GAAG,sCAAwBD,GAAxB,CAAzB;AAEAC,IAAAA,gBAAgB,CAACF,OAAjB,CAAyB,CAACG,UAAD,EAAaC,MAAb,KAAwB;AAC/C,UAAIR,OAAO,CAACQ,MAAD,CAAP,GAAkBD,UAAtB,EAAkC;AAChCP,QAAAA,OAAO,CAACQ,MAAD,CAAP,GAAkBD,UAAlB;AACD;AACF,KAJD;AAKD,GARD;AAUA,SAAOP,OAAP;AACD,C","sourcesContent":["import calculateCellWidthIndex from './calculateCellWidthIndex';\n\n/**\n * Produces an array of values that describe the largest value length (width) in every column.\n *\n * @param {Array[]} rows\n * @returns {number[]}\n */\nexport default (rows) => {\n if (!rows[0]) {\n throw new Error('Dataset must have at least one row.');\n }\n\n const columns = new Array(rows[0].length).fill(0);\n\n rows.forEach((row) => {\n const columnWidthIndex = calculateCellWidthIndex(row);\n\n columnWidthIndex.forEach((valueWidth, index0) => {\n if (columns[index0] < valueWidth) {\n columns[index0] = valueWidth;\n }\n });\n });\n\n return columns;\n};\n"],"file":"calculateMaximumColumnWidthIndex.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateRowHeightIndex.js b/tools/node_modules/eslint/node_modules/table/dist/calculateRowHeightIndex.js index 2976ec43344c67..ad98db4040048c 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/calculateRowHeightIndex.js +++ b/tools/node_modules/eslint/node_modules/table/dist/calculateRowHeightIndex.js @@ -1,16 +1,13 @@ -'use strict'; +"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = void 0; -var _lodash = require('lodash'); +var _lodash = _interopRequireDefault(require("lodash")); -var _lodash2 = _interopRequireDefault(_lodash); - -var _calculateCellHeight = require('./calculateCellHeight'); - -var _calculateCellHeight2 = _interopRequireDefault(_calculateCellHeight); +var _calculateCellHeight = _interopRequireDefault(require("./calculateCellHeight")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -21,28 +18,27 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * @param {Object} config * @returns {number[]} */ -exports.default = (rows, config) => { +const calculateRowHeightIndex = (rows, config) => { const tableWidth = rows[0].length; - const rowSpanIndex = []; - rows.forEach(cells => { - const cellHeightIndex = Array(tableWidth).fill(1); - + const cellHeightIndex = new Array(tableWidth).fill(1); cells.forEach((value, index1) => { - if (!_lodash2.default.isNumber(config.columns[index1].width)) { + if (!_lodash.default.isNumber(config.columns[index1].width)) { throw new TypeError('column[index].width must be a number.'); } - if (!_lodash2.default.isBoolean(config.columns[index1].wrapWord)) { + if (!_lodash.default.isBoolean(config.columns[index1].wrapWord)) { throw new TypeError('column[index].wrapWord must be a boolean.'); } - cellHeightIndex[index1] = (0, _calculateCellHeight2.default)(value, config.columns[index1].width, config.columns[index1].wrapWord); + cellHeightIndex[index1] = (0, _calculateCellHeight.default)(value, config.columns[index1].width, config.columns[index1].wrapWord); }); - - rowSpanIndex.push(_lodash2.default.max(cellHeightIndex)); + rowSpanIndex.push(_lodash.default.max(cellHeightIndex)); }); - return rowSpanIndex; -}; \ No newline at end of file +}; + +var _default = calculateRowHeightIndex; +exports.default = _default; +//# sourceMappingURL=calculateRowHeightIndex.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateRowHeightIndex.js.flow b/tools/node_modules/eslint/node_modules/table/dist/calculateRowHeightIndex.js.flow new file mode 100644 index 00000000000000..268790264860e6 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/calculateRowHeightIndex.js.flow @@ -0,0 +1,35 @@ +import _ from 'lodash'; +import calculateCellHeight from './calculateCellHeight'; + +/** + * Calculates the vertical row span index. + * + * @param {Array[]} rows + * @param {Object} config + * @returns {number[]} + */ +export default (rows, config) => { + const tableWidth = rows[0].length; + + const rowSpanIndex = []; + + rows.forEach((cells) => { + const cellHeightIndex = new Array(tableWidth).fill(1); + + cells.forEach((value, index1) => { + if (!_.isNumber(config.columns[index1].width)) { + throw new TypeError('column[index].width must be a number.'); + } + + if (!_.isBoolean(config.columns[index1].wrapWord)) { + throw new TypeError('column[index].wrapWord must be a boolean.'); + } + + cellHeightIndex[index1] = calculateCellHeight(value, config.columns[index1].width, config.columns[index1].wrapWord); + }); + + rowSpanIndex.push(_.max(cellHeightIndex)); + }); + + return rowSpanIndex; +}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateRowHeightIndex.js.map b/tools/node_modules/eslint/node_modules/table/dist/calculateRowHeightIndex.js.map new file mode 100644 index 00000000000000..bcd21c8e5e4354 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/calculateRowHeightIndex.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/calculateRowHeightIndex.js"],"names":["rows","config","tableWidth","length","rowSpanIndex","forEach","cells","cellHeightIndex","Array","fill","value","index1","_","isNumber","columns","width","TypeError","isBoolean","wrapWord","push","max"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA;;;;;;;iCAOgBA,I,EAAMC,M,KAAW;AAC/B,QAAMC,UAAU,GAAGF,IAAI,CAAC,CAAD,CAAJ,CAAQG,MAA3B;AAEA,QAAMC,YAAY,GAAG,EAArB;AAEAJ,EAAAA,IAAI,CAACK,OAAL,CAAcC,KAAD,IAAW;AACtB,UAAMC,eAAe,GAAG,IAAIC,KAAJ,CAAUN,UAAV,EAAsBO,IAAtB,CAA2B,CAA3B,CAAxB;AAEAH,IAAAA,KAAK,CAACD,OAAN,CAAc,CAACK,KAAD,EAAQC,MAAR,KAAmB;AAC/B,UAAI,CAACC,gBAAEC,QAAF,CAAWZ,MAAM,CAACa,OAAP,CAAeH,MAAf,EAAuBI,KAAlC,CAAL,EAA+C;AAC7C,cAAM,IAAIC,SAAJ,CAAc,uCAAd,CAAN;AACD;;AAED,UAAI,CAACJ,gBAAEK,SAAF,CAAYhB,MAAM,CAACa,OAAP,CAAeH,MAAf,EAAuBO,QAAnC,CAAL,EAAmD;AACjD,cAAM,IAAIF,SAAJ,CAAc,2CAAd,CAAN;AACD;;AAEDT,MAAAA,eAAe,CAACI,MAAD,CAAf,GAA0B,kCAAoBD,KAApB,EAA2BT,MAAM,CAACa,OAAP,CAAeH,MAAf,EAAuBI,KAAlD,EAAyDd,MAAM,CAACa,OAAP,CAAeH,MAAf,EAAuBO,QAAhF,CAA1B;AACD,KAVD;AAYAd,IAAAA,YAAY,CAACe,IAAb,CAAkBP,gBAAEQ,GAAF,CAAMb,eAAN,CAAlB;AACD,GAhBD;AAkBA,SAAOH,YAAP;AACD,C","sourcesContent":["import _ from 'lodash';\nimport calculateCellHeight from './calculateCellHeight';\n\n/**\n * Calculates the vertical row span index.\n *\n * @param {Array[]} rows\n * @param {Object} config\n * @returns {number[]}\n */\nexport default (rows, config) => {\n const tableWidth = rows[0].length;\n\n const rowSpanIndex = [];\n\n rows.forEach((cells) => {\n const cellHeightIndex = new Array(tableWidth).fill(1);\n\n cells.forEach((value, index1) => {\n if (!_.isNumber(config.columns[index1].width)) {\n throw new TypeError('column[index].width must be a number.');\n }\n\n if (!_.isBoolean(config.columns[index1].wrapWord)) {\n throw new TypeError('column[index].wrapWord must be a boolean.');\n }\n\n cellHeightIndex[index1] = calculateCellHeight(value, config.columns[index1].width, config.columns[index1].wrapWord);\n });\n\n rowSpanIndex.push(_.max(cellHeightIndex));\n });\n\n return rowSpanIndex;\n};\n"],"file":"calculateRowHeightIndex.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/createStream.js b/tools/node_modules/eslint/node_modules/table/dist/createStream.js index 83698f0e036e27..f1eb06106e4ca1 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/createStream.js +++ b/tools/node_modules/eslint/node_modules/table/dist/createStream.js @@ -1,46 +1,29 @@ -'use strict'; +"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = void 0; -var _lodash = require('lodash'); +var _lodash = _interopRequireDefault(require("lodash")); -var _lodash2 = _interopRequireDefault(_lodash); +var _makeStreamConfig = _interopRequireDefault(require("./makeStreamConfig")); -var _makeStreamConfig = require('./makeStreamConfig'); +var _drawRow = _interopRequireDefault(require("./drawRow")); -var _makeStreamConfig2 = _interopRequireDefault(_makeStreamConfig); +var _drawBorder = require("./drawBorder"); -var _drawRow = require('./drawRow'); +var _stringifyTableData = _interopRequireDefault(require("./stringifyTableData")); -var _drawRow2 = _interopRequireDefault(_drawRow); +var _truncateTableData = _interopRequireDefault(require("./truncateTableData")); -var _drawBorder = require('./drawBorder'); +var _mapDataUsingRowHeightIndex = _interopRequireDefault(require("./mapDataUsingRowHeightIndex")); -var _stringifyTableData = require('./stringifyTableData'); +var _alignTableData = _interopRequireDefault(require("./alignTableData")); -var _stringifyTableData2 = _interopRequireDefault(_stringifyTableData); +var _padTableData = _interopRequireDefault(require("./padTableData")); -var _truncateTableData = require('./truncateTableData'); - -var _truncateTableData2 = _interopRequireDefault(_truncateTableData); - -var _mapDataUsingRowHeightIndex = require('./mapDataUsingRowHeightIndex'); - -var _mapDataUsingRowHeightIndex2 = _interopRequireDefault(_mapDataUsingRowHeightIndex); - -var _alignTableData = require('./alignTableData'); - -var _alignTableData2 = _interopRequireDefault(_alignTableData); - -var _padTableData = require('./padTableData'); - -var _padTableData2 = _interopRequireDefault(_padTableData); - -var _calculateRowHeightIndex = require('./calculateRowHeightIndex'); - -var _calculateRowHeightIndex2 = _interopRequireDefault(_calculateRowHeightIndex); +var _calculateRowHeightIndex = _interopRequireDefault(require("./calculateRowHeightIndex")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -51,90 +34,71 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de */ const prepareData = (data, config) => { let rows; - - rows = (0, _stringifyTableData2.default)(data); - - rows = (0, _truncateTableData2.default)(data, config); - - const rowHeightIndex = (0, _calculateRowHeightIndex2.default)(rows, config); - - rows = (0, _mapDataUsingRowHeightIndex2.default)(rows, rowHeightIndex, config); - rows = (0, _alignTableData2.default)(rows, config); - rows = (0, _padTableData2.default)(rows, config); - + rows = (0, _stringifyTableData.default)(data); + rows = (0, _truncateTableData.default)(data, config); + const rowHeightIndex = (0, _calculateRowHeightIndex.default)(rows, config); + rows = (0, _mapDataUsingRowHeightIndex.default)(rows, rowHeightIndex, config); + rows = (0, _alignTableData.default)(rows, config); + rows = (0, _padTableData.default)(rows, config); return rows; }; - /** * @param {string[]} row * @param {number[]} columnWidthIndex * @param {Object} config * @returns {undefined} */ + + const create = (row, columnWidthIndex, config) => { const rows = prepareData([row], config); - const body = rows.map(literalRow => { - return (0, _drawRow2.default)(literalRow, config.border); + return (0, _drawRow.default)(literalRow, config.border); }).join(''); - let output; - output = ''; - output += (0, _drawBorder.drawBorderTop)(columnWidthIndex, config.border); output += body; output += (0, _drawBorder.drawBorderBottom)(columnWidthIndex, config.border); - - output = _lodash2.default.trimEnd(output); - + output = _lodash.default.trimEnd(output); process.stdout.write(output); }; - /** * @param {string[]} row * @param {number[]} columnWidthIndex * @param {Object} config * @returns {undefined} */ + + const append = (row, columnWidthIndex, config) => { const rows = prepareData([row], config); - const body = rows.map(literalRow => { - return (0, _drawRow2.default)(literalRow, config.border); + return (0, _drawRow.default)(literalRow, config.border); }).join(''); - let output; - output = '\r\u001B[K'; - output += (0, _drawBorder.drawBorderJoin)(columnWidthIndex, config.border); output += body; output += (0, _drawBorder.drawBorderBottom)(columnWidthIndex, config.border); - - output = _lodash2.default.trimEnd(output); - + output = _lodash.default.trimEnd(output); process.stdout.write(output); }; - /** * @param {Object} userConfig * @returns {Object} */ -exports.default = function () { - let userConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - const config = (0, _makeStreamConfig2.default)(userConfig); +const createStream = (userConfig = {}) => { + const config = (0, _makeStreamConfig.default)(userConfig); // @todo Use 'Object.values' when Node.js v6 support is dropped. - const columnWidthIndex = _lodash2.default.mapValues(config.columns, column => { + const columnWidthIndex = _lodash.default.values(_lodash.default.mapValues(config.columns, column => { return column.width + column.paddingLeft + column.paddingRight; - }); + })); let empty; - empty = true; - return { /** * @param {string[]} row @@ -147,11 +111,14 @@ exports.default = function () { if (empty) { empty = false; - return create(row, columnWidthIndex, config); } else { return append(row, columnWidthIndex, config); } } }; -}; \ No newline at end of file +}; + +var _default = createStream; +exports.default = _default; +//# sourceMappingURL=createStream.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/createStream.js.flow b/tools/node_modules/eslint/node_modules/table/dist/createStream.js.flow new file mode 100644 index 00000000000000..1d7d00e399c4a3 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/createStream.js.flow @@ -0,0 +1,124 @@ +import _ from 'lodash'; +import makeStreamConfig from './makeStreamConfig'; +import drawRow from './drawRow'; +import { + drawBorderBottom, + drawBorderJoin, + drawBorderTop +} from './drawBorder'; +import stringifyTableData from './stringifyTableData'; +import truncateTableData from './truncateTableData'; +import mapDataUsingRowHeightIndex from './mapDataUsingRowHeightIndex'; +import alignTableData from './alignTableData'; +import padTableData from './padTableData'; +import calculateRowHeightIndex from './calculateRowHeightIndex'; + +/** + * @param {Array} data + * @param {Object} config + * @returns {Array} + */ +const prepareData = (data, config) => { + let rows; + + rows = stringifyTableData(data); + + rows = truncateTableData(data, config); + + const rowHeightIndex = calculateRowHeightIndex(rows, config); + + rows = mapDataUsingRowHeightIndex(rows, rowHeightIndex, config); + rows = alignTableData(rows, config); + rows = padTableData(rows, config); + + return rows; +}; + +/** + * @param {string[]} row + * @param {number[]} columnWidthIndex + * @param {Object} config + * @returns {undefined} + */ +const create = (row, columnWidthIndex, config) => { + const rows = prepareData([row], config); + + const body = rows.map((literalRow) => { + return drawRow(literalRow, config.border); + }).join(''); + + let output; + + output = ''; + + output += drawBorderTop(columnWidthIndex, config.border); + output += body; + output += drawBorderBottom(columnWidthIndex, config.border); + + output = _.trimEnd(output); + + process.stdout.write(output); +}; + +/** + * @param {string[]} row + * @param {number[]} columnWidthIndex + * @param {Object} config + * @returns {undefined} + */ +const append = (row, columnWidthIndex, config) => { + const rows = prepareData([row], config); + + const body = rows.map((literalRow) => { + return drawRow(literalRow, config.border); + }).join(''); + + let output; + + output = '\r\u001B[K'; + + output += drawBorderJoin(columnWidthIndex, config.border); + output += body; + output += drawBorderBottom(columnWidthIndex, config.border); + + output = _.trimEnd(output); + + process.stdout.write(output); +}; + +/** + * @param {Object} userConfig + * @returns {Object} + */ +export default (userConfig = {}) => { + const config = makeStreamConfig(userConfig); + + // @todo Use 'Object.values' when Node.js v6 support is dropped. + const columnWidthIndex = _.values(_.mapValues(config.columns, (column) => { + return column.width + column.paddingLeft + column.paddingRight; + })); + + let empty; + + empty = true; + + return { + /** + * @param {string[]} row + * @returns {undefined} + */ + write: (row) => { + if (row.length !== config.columnCount) { + throw new Error('Row cell count does not match the config.columnCount.'); + } + + if (empty) { + empty = false; + + return create(row, columnWidthIndex, config); + } else { + return append(row, columnWidthIndex, config); + } + } + }; +}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/createStream.js.map b/tools/node_modules/eslint/node_modules/table/dist/createStream.js.map new file mode 100644 index 00000000000000..92cf88794cefc2 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/createStream.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/createStream.js"],"names":["prepareData","data","config","rows","rowHeightIndex","create","row","columnWidthIndex","body","map","literalRow","border","join","output","_","trimEnd","process","stdout","write","append","userConfig","values","mapValues","columns","column","width","paddingLeft","paddingRight","empty","length","columnCount","Error"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA;;;;;AAKA,MAAMA,WAAW,GAAG,CAACC,IAAD,EAAOC,MAAP,KAAkB;AACpC,MAAIC,IAAJ;AAEAA,EAAAA,IAAI,GAAG,iCAAmBF,IAAnB,CAAP;AAEAE,EAAAA,IAAI,GAAG,gCAAkBF,IAAlB,EAAwBC,MAAxB,CAAP;AAEA,QAAME,cAAc,GAAG,sCAAwBD,IAAxB,EAA8BD,MAA9B,CAAvB;AAEAC,EAAAA,IAAI,GAAG,yCAA2BA,IAA3B,EAAiCC,cAAjC,EAAiDF,MAAjD,CAAP;AACAC,EAAAA,IAAI,GAAG,6BAAeA,IAAf,EAAqBD,MAArB,CAAP;AACAC,EAAAA,IAAI,GAAG,2BAAaA,IAAb,EAAmBD,MAAnB,CAAP;AAEA,SAAOC,IAAP;AACD,CAdD;AAgBA;;;;;;;;AAMA,MAAME,MAAM,GAAG,CAACC,GAAD,EAAMC,gBAAN,EAAwBL,MAAxB,KAAmC;AAChD,QAAMC,IAAI,GAAGH,WAAW,CAAC,CAACM,GAAD,CAAD,EAAQJ,MAAR,CAAxB;AAEA,QAAMM,IAAI,GAAGL,IAAI,CAACM,GAAL,CAAUC,UAAD,IAAgB;AACpC,WAAO,sBAAQA,UAAR,EAAoBR,MAAM,CAACS,MAA3B,CAAP;AACD,GAFY,EAEVC,IAFU,CAEL,EAFK,CAAb;AAIA,MAAIC,MAAJ;AAEAA,EAAAA,MAAM,GAAG,EAAT;AAEAA,EAAAA,MAAM,IAAI,+BAAcN,gBAAd,EAAgCL,MAAM,CAACS,MAAvC,CAAV;AACAE,EAAAA,MAAM,IAAIL,IAAV;AACAK,EAAAA,MAAM,IAAI,kCAAiBN,gBAAjB,EAAmCL,MAAM,CAACS,MAA1C,CAAV;AAEAE,EAAAA,MAAM,GAAGC,gBAAEC,OAAF,CAAUF,MAAV,CAAT;AAEAG,EAAAA,OAAO,CAACC,MAAR,CAAeC,KAAf,CAAqBL,MAArB;AACD,CAlBD;AAoBA;;;;;;;;AAMA,MAAMM,MAAM,GAAG,CAACb,GAAD,EAAMC,gBAAN,EAAwBL,MAAxB,KAAmC;AAChD,QAAMC,IAAI,GAAGH,WAAW,CAAC,CAACM,GAAD,CAAD,EAAQJ,MAAR,CAAxB;AAEA,QAAMM,IAAI,GAAGL,IAAI,CAACM,GAAL,CAAUC,UAAD,IAAgB;AACpC,WAAO,sBAAQA,UAAR,EAAoBR,MAAM,CAACS,MAA3B,CAAP;AACD,GAFY,EAEVC,IAFU,CAEL,EAFK,CAAb;AAIA,MAAIC,MAAJ;AAEAA,EAAAA,MAAM,GAAG,YAAT;AAEAA,EAAAA,MAAM,IAAI,gCAAeN,gBAAf,EAAiCL,MAAM,CAACS,MAAxC,CAAV;AACAE,EAAAA,MAAM,IAAIL,IAAV;AACAK,EAAAA,MAAM,IAAI,kCAAiBN,gBAAjB,EAAmCL,MAAM,CAACS,MAA1C,CAAV;AAEAE,EAAAA,MAAM,GAAGC,gBAAEC,OAAF,CAAUF,MAAV,CAAT;AAEAG,EAAAA,OAAO,CAACC,MAAR,CAAeC,KAAf,CAAqBL,MAArB;AACD,CAlBD;AAoBA;;;;;;sBAIgBO,UAAU,GAAG,E,KAAO;AAClC,QAAMlB,MAAM,GAAG,+BAAiBkB,UAAjB,CAAf,CADkC,CAGlC;;AACA,QAAMb,gBAAgB,GAAGO,gBAAEO,MAAF,CAASP,gBAAEQ,SAAF,CAAYpB,MAAM,CAACqB,OAAnB,EAA6BC,MAAD,IAAY;AACxE,WAAOA,MAAM,CAACC,KAAP,GAAeD,MAAM,CAACE,WAAtB,GAAoCF,MAAM,CAACG,YAAlD;AACD,GAFiC,CAAT,CAAzB;;AAIA,MAAIC,KAAJ;AAEAA,EAAAA,KAAK,GAAG,IAAR;AAEA,SAAO;AACL;;;;AAIAV,IAAAA,KAAK,EAAGZ,GAAD,IAAS;AACd,UAAIA,GAAG,CAACuB,MAAJ,KAAe3B,MAAM,CAAC4B,WAA1B,EAAuC;AACrC,cAAM,IAAIC,KAAJ,CAAU,uDAAV,CAAN;AACD;;AAED,UAAIH,KAAJ,EAAW;AACTA,QAAAA,KAAK,GAAG,KAAR;AAEA,eAAOvB,MAAM,CAACC,GAAD,EAAMC,gBAAN,EAAwBL,MAAxB,CAAb;AACD,OAJD,MAIO;AACL,eAAOiB,MAAM,CAACb,GAAD,EAAMC,gBAAN,EAAwBL,MAAxB,CAAb;AACD;AACF;AAjBI,GAAP;AAmBD,C","sourcesContent":["import _ from 'lodash';\nimport makeStreamConfig from './makeStreamConfig';\nimport drawRow from './drawRow';\nimport {\n drawBorderBottom,\n drawBorderJoin,\n drawBorderTop\n} from './drawBorder';\nimport stringifyTableData from './stringifyTableData';\nimport truncateTableData from './truncateTableData';\nimport mapDataUsingRowHeightIndex from './mapDataUsingRowHeightIndex';\nimport alignTableData from './alignTableData';\nimport padTableData from './padTableData';\nimport calculateRowHeightIndex from './calculateRowHeightIndex';\n\n/**\n * @param {Array} data\n * @param {Object} config\n * @returns {Array}\n */\nconst prepareData = (data, config) => {\n let rows;\n\n rows = stringifyTableData(data);\n\n rows = truncateTableData(data, config);\n\n const rowHeightIndex = calculateRowHeightIndex(rows, config);\n\n rows = mapDataUsingRowHeightIndex(rows, rowHeightIndex, config);\n rows = alignTableData(rows, config);\n rows = padTableData(rows, config);\n\n return rows;\n};\n\n/**\n * @param {string[]} row\n * @param {number[]} columnWidthIndex\n * @param {Object} config\n * @returns {undefined}\n */\nconst create = (row, columnWidthIndex, config) => {\n const rows = prepareData([row], config);\n\n const body = rows.map((literalRow) => {\n return drawRow(literalRow, config.border);\n }).join('');\n\n let output;\n\n output = '';\n\n output += drawBorderTop(columnWidthIndex, config.border);\n output += body;\n output += drawBorderBottom(columnWidthIndex, config.border);\n\n output = _.trimEnd(output);\n\n process.stdout.write(output);\n};\n\n/**\n * @param {string[]} row\n * @param {number[]} columnWidthIndex\n * @param {Object} config\n * @returns {undefined}\n */\nconst append = (row, columnWidthIndex, config) => {\n const rows = prepareData([row], config);\n\n const body = rows.map((literalRow) => {\n return drawRow(literalRow, config.border);\n }).join('');\n\n let output;\n\n output = '\\r\\u001B[K';\n\n output += drawBorderJoin(columnWidthIndex, config.border);\n output += body;\n output += drawBorderBottom(columnWidthIndex, config.border);\n\n output = _.trimEnd(output);\n\n process.stdout.write(output);\n};\n\n/**\n * @param {Object} userConfig\n * @returns {Object}\n */\nexport default (userConfig = {}) => {\n const config = makeStreamConfig(userConfig);\n\n // @todo Use 'Object.values' when Node.js v6 support is dropped.\n const columnWidthIndex = _.values(_.mapValues(config.columns, (column) => {\n return column.width + column.paddingLeft + column.paddingRight;\n }));\n\n let empty;\n\n empty = true;\n\n return {\n /**\n * @param {string[]} row\n * @returns {undefined}\n */\n write: (row) => {\n if (row.length !== config.columnCount) {\n throw new Error('Row cell count does not match the config.columnCount.');\n }\n\n if (empty) {\n empty = false;\n\n return create(row, columnWidthIndex, config);\n } else {\n return append(row, columnWidthIndex, config);\n }\n }\n };\n};\n"],"file":"createStream.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js b/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js index beae57f1a2885f..cb7c54077a3fd1 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js +++ b/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js @@ -1,8 +1,10 @@ -'use strict'; +"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.drawBorderTop = exports.drawBorderJoin = exports.drawBorderBottom = exports.drawBorder = void 0; + /** * @typedef drawBorder~parts * @property {string} left @@ -20,10 +22,8 @@ const drawBorder = (columnSizeIndex, parts) => { const columns = columnSizeIndex.map(size => { return parts.body.repeat(size); }).join(parts.join); - return parts.left + columns + parts.right + '\n'; }; - /** * @typedef drawBorderTop~parts * @property {string} topLeft @@ -37,6 +37,10 @@ const drawBorder = (columnSizeIndex, parts) => { * @param {drawBorderTop~parts} parts * @returns {string} */ + + +exports.drawBorder = drawBorder; + const drawBorderTop = (columnSizeIndex, parts) => { return drawBorder(columnSizeIndex, { body: parts.topBody, @@ -45,7 +49,6 @@ const drawBorderTop = (columnSizeIndex, parts) => { right: parts.topRight }); }; - /** * @typedef drawBorderJoin~parts * @property {string} joinLeft @@ -59,6 +62,10 @@ const drawBorderTop = (columnSizeIndex, parts) => { * @param {drawBorderJoin~parts} parts * @returns {string} */ + + +exports.drawBorderTop = drawBorderTop; + const drawBorderJoin = (columnSizeIndex, parts) => { return drawBorder(columnSizeIndex, { body: parts.joinBody, @@ -67,7 +74,6 @@ const drawBorderJoin = (columnSizeIndex, parts) => { right: parts.joinRight }); }; - /** * @typedef drawBorderBottom~parts * @property {string} topLeft @@ -81,6 +87,10 @@ const drawBorderJoin = (columnSizeIndex, parts) => { * @param {drawBorderBottom~parts} parts * @returns {string} */ + + +exports.drawBorderJoin = drawBorderJoin; + const drawBorderBottom = (columnSizeIndex, parts) => { return drawBorder(columnSizeIndex, { body: parts.bottomBody, @@ -90,7 +100,5 @@ const drawBorderBottom = (columnSizeIndex, parts) => { }); }; -exports.drawBorder = drawBorder; exports.drawBorderBottom = drawBorderBottom; -exports.drawBorderJoin = drawBorderJoin; -exports.drawBorderTop = drawBorderTop; \ No newline at end of file +//# sourceMappingURL=drawBorder.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js.flow b/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js.flow new file mode 100644 index 00000000000000..5d5f5d9ac2e90f --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js.flow @@ -0,0 +1,95 @@ +/** + * @typedef drawBorder~parts + * @property {string} left + * @property {string} right + * @property {string} body + * @property {string} join + */ + +/** + * @param {number[]} columnSizeIndex + * @param {drawBorder~parts} parts + * @returns {string} + */ +const drawBorder = (columnSizeIndex, parts) => { + const columns = columnSizeIndex + .map((size) => { + return parts.body.repeat(size); + }) + .join(parts.join); + + return parts.left + columns + parts.right + '\n'; +}; + +/** + * @typedef drawBorderTop~parts + * @property {string} topLeft + * @property {string} topRight + * @property {string} topBody + * @property {string} topJoin + */ + +/** + * @param {number[]} columnSizeIndex + * @param {drawBorderTop~parts} parts + * @returns {string} + */ +const drawBorderTop = (columnSizeIndex, parts) => { + return drawBorder(columnSizeIndex, { + body: parts.topBody, + join: parts.topJoin, + left: parts.topLeft, + right: parts.topRight + }); +}; + +/** + * @typedef drawBorderJoin~parts + * @property {string} joinLeft + * @property {string} joinRight + * @property {string} joinBody + * @property {string} joinJoin + */ + +/** + * @param {number[]} columnSizeIndex + * @param {drawBorderJoin~parts} parts + * @returns {string} + */ +const drawBorderJoin = (columnSizeIndex, parts) => { + return drawBorder(columnSizeIndex, { + body: parts.joinBody, + join: parts.joinJoin, + left: parts.joinLeft, + right: parts.joinRight + }); +}; + +/** + * @typedef drawBorderBottom~parts + * @property {string} topLeft + * @property {string} topRight + * @property {string} topBody + * @property {string} topJoin + */ + +/** + * @param {number[]} columnSizeIndex + * @param {drawBorderBottom~parts} parts + * @returns {string} + */ +const drawBorderBottom = (columnSizeIndex, parts) => { + return drawBorder(columnSizeIndex, { + body: parts.bottomBody, + join: parts.bottomJoin, + left: parts.bottomLeft, + right: parts.bottomRight + }); +}; + +export { + drawBorder, + drawBorderBottom, + drawBorderJoin, + drawBorderTop +}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js.map b/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js.map new file mode 100644 index 00000000000000..dfdfccd0f4ee3d --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/drawBorder.js"],"names":["drawBorder","columnSizeIndex","parts","columns","map","size","body","repeat","join","left","right","drawBorderTop","topBody","topJoin","topLeft","topRight","drawBorderJoin","joinBody","joinJoin","joinLeft","joinRight","drawBorderBottom","bottomBody","bottomJoin","bottomLeft","bottomRight"],"mappings":";;;;;;;AAAA;;;;;;;;AAQA;;;;;AAKA,MAAMA,UAAU,GAAG,CAACC,eAAD,EAAkBC,KAAlB,KAA4B;AAC7C,QAAMC,OAAO,GAAGF,eAAe,CAC5BG,GADa,CACRC,IAAD,IAAU;AACb,WAAOH,KAAK,CAACI,IAAN,CAAWC,MAAX,CAAkBF,IAAlB,CAAP;AACD,GAHa,EAIbG,IAJa,CAIRN,KAAK,CAACM,IAJE,CAAhB;AAMA,SAAON,KAAK,CAACO,IAAN,GAAaN,OAAb,GAAuBD,KAAK,CAACQ,KAA7B,GAAqC,IAA5C;AACD,CARD;AAUA;;;;;;;;AAQA;;;;;;;;;AAKA,MAAMC,aAAa,GAAG,CAACV,eAAD,EAAkBC,KAAlB,KAA4B;AAChD,SAAOF,UAAU,CAACC,eAAD,EAAkB;AACjCK,IAAAA,IAAI,EAAEJ,KAAK,CAACU,OADqB;AAEjCJ,IAAAA,IAAI,EAAEN,KAAK,CAACW,OAFqB;AAGjCJ,IAAAA,IAAI,EAAEP,KAAK,CAACY,OAHqB;AAIjCJ,IAAAA,KAAK,EAAER,KAAK,CAACa;AAJoB,GAAlB,CAAjB;AAMD,CAPD;AASA;;;;;;;;AAQA;;;;;;;;;AAKA,MAAMC,cAAc,GAAG,CAACf,eAAD,EAAkBC,KAAlB,KAA4B;AACjD,SAAOF,UAAU,CAACC,eAAD,EAAkB;AACjCK,IAAAA,IAAI,EAAEJ,KAAK,CAACe,QADqB;AAEjCT,IAAAA,IAAI,EAAEN,KAAK,CAACgB,QAFqB;AAGjCT,IAAAA,IAAI,EAAEP,KAAK,CAACiB,QAHqB;AAIjCT,IAAAA,KAAK,EAAER,KAAK,CAACkB;AAJoB,GAAlB,CAAjB;AAMD,CAPD;AASA;;;;;;;;AAQA;;;;;;;;;AAKA,MAAMC,gBAAgB,GAAG,CAACpB,eAAD,EAAkBC,KAAlB,KAA4B;AACnD,SAAOF,UAAU,CAACC,eAAD,EAAkB;AACjCK,IAAAA,IAAI,EAAEJ,KAAK,CAACoB,UADqB;AAEjCd,IAAAA,IAAI,EAAEN,KAAK,CAACqB,UAFqB;AAGjCd,IAAAA,IAAI,EAAEP,KAAK,CAACsB,UAHqB;AAIjCd,IAAAA,KAAK,EAAER,KAAK,CAACuB;AAJoB,GAAlB,CAAjB;AAMD,CAPD","sourcesContent":["/**\n * @typedef drawBorder~parts\n * @property {string} left\n * @property {string} right\n * @property {string} body\n * @property {string} join\n */\n\n/**\n * @param {number[]} columnSizeIndex\n * @param {drawBorder~parts} parts\n * @returns {string}\n */\nconst drawBorder = (columnSizeIndex, parts) => {\n const columns = columnSizeIndex\n .map((size) => {\n return parts.body.repeat(size);\n })\n .join(parts.join);\n\n return parts.left + columns + parts.right + '\\n';\n};\n\n/**\n * @typedef drawBorderTop~parts\n * @property {string} topLeft\n * @property {string} topRight\n * @property {string} topBody\n * @property {string} topJoin\n */\n\n/**\n * @param {number[]} columnSizeIndex\n * @param {drawBorderTop~parts} parts\n * @returns {string}\n */\nconst drawBorderTop = (columnSizeIndex, parts) => {\n return drawBorder(columnSizeIndex, {\n body: parts.topBody,\n join: parts.topJoin,\n left: parts.topLeft,\n right: parts.topRight\n });\n};\n\n/**\n * @typedef drawBorderJoin~parts\n * @property {string} joinLeft\n * @property {string} joinRight\n * @property {string} joinBody\n * @property {string} joinJoin\n */\n\n/**\n * @param {number[]} columnSizeIndex\n * @param {drawBorderJoin~parts} parts\n * @returns {string}\n */\nconst drawBorderJoin = (columnSizeIndex, parts) => {\n return drawBorder(columnSizeIndex, {\n body: parts.joinBody,\n join: parts.joinJoin,\n left: parts.joinLeft,\n right: parts.joinRight\n });\n};\n\n/**\n * @typedef drawBorderBottom~parts\n * @property {string} topLeft\n * @property {string} topRight\n * @property {string} topBody\n * @property {string} topJoin\n */\n\n/**\n * @param {number[]} columnSizeIndex\n * @param {drawBorderBottom~parts} parts\n * @returns {string}\n */\nconst drawBorderBottom = (columnSizeIndex, parts) => {\n return drawBorder(columnSizeIndex, {\n body: parts.bottomBody,\n join: parts.bottomJoin,\n left: parts.bottomLeft,\n right: parts.bottomRight\n });\n};\n\nexport {\n drawBorder,\n drawBorderBottom,\n drawBorderJoin,\n drawBorderTop\n};\n"],"file":"drawBorder.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/drawRow.js b/tools/node_modules/eslint/node_modules/table/dist/drawRow.js index 65547fba058caf..800ca25bc3df7e 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/drawRow.js +++ b/tools/node_modules/eslint/node_modules/table/dist/drawRow.js @@ -1,8 +1,9 @@ -'use strict'; +"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = void 0; /** * @typedef {Object} drawRow~border @@ -16,6 +17,10 @@ Object.defineProperty(exports, "__esModule", { * @param {drawRow~border} border * @returns {string} */ -exports.default = (columns, border) => { +const drawRow = (columns, border) => { return border.bodyLeft + columns.join(border.bodyJoin) + border.bodyRight + '\n'; -}; \ No newline at end of file +}; + +var _default = drawRow; +exports.default = _default; +//# sourceMappingURL=drawRow.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/drawRow.js.flow b/tools/node_modules/eslint/node_modules/table/dist/drawRow.js.flow new file mode 100644 index 00000000000000..fdeceefa31880a --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/drawRow.js.flow @@ -0,0 +1,15 @@ +/** + * @typedef {Object} drawRow~border + * @property {string} bodyLeft + * @property {string} bodyRight + * @property {string} bodyJoin + */ + +/** + * @param {number[]} columns + * @param {drawRow~border} border + * @returns {string} + */ +export default (columns, border) => { + return border.bodyLeft + columns.join(border.bodyJoin) + border.bodyRight + '\n'; +}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/drawRow.js.map b/tools/node_modules/eslint/node_modules/table/dist/drawRow.js.map new file mode 100644 index 00000000000000..4541d1961520d6 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/drawRow.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/drawRow.js"],"names":["columns","border","bodyLeft","join","bodyJoin","bodyRight"],"mappings":";;;;;;;AAAA;;;;;;;AAOA;;;;;iBAKgBA,O,EAASC,M,KAAW;AAClC,SAAOA,MAAM,CAACC,QAAP,GAAkBF,OAAO,CAACG,IAAR,CAAaF,MAAM,CAACG,QAApB,CAAlB,GAAkDH,MAAM,CAACI,SAAzD,GAAqE,IAA5E;AACD,C","sourcesContent":["/**\n * @typedef {Object} drawRow~border\n * @property {string} bodyLeft\n * @property {string} bodyRight\n * @property {string} bodyJoin\n */\n\n/**\n * @param {number[]} columns\n * @param {drawRow~border} border\n * @returns {string}\n */\nexport default (columns, border) => {\n return border.bodyLeft + columns.join(border.bodyJoin) + border.bodyRight + '\\n';\n};\n"],"file":"drawRow.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/drawTable.js b/tools/node_modules/eslint/node_modules/table/dist/drawTable.js index 01e8c3e14d4af6..5585af888f6612 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/drawTable.js +++ b/tools/node_modules/eslint/node_modules/table/dist/drawTable.js @@ -1,14 +1,13 @@ -'use strict'; +"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = void 0; -var _drawBorder = require('./drawBorder'); +var _drawBorder = require("./drawBorder"); -var _drawRow = require('./drawRow'); - -var _drawRow2 = _interopRequireDefault(_drawRow); +var _drawRow = _interopRequireDefault(require("./drawRow")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -20,15 +19,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * @param {Function} drawHorizontalLine * @returns {string} */ -exports.default = (rows, border, columnSizeIndex, rowSpanIndex, drawHorizontalLine) => { +const drawTable = (rows, border, columnSizeIndex, rowSpanIndex, drawHorizontalLine) => { let output; let realRowIndex; let rowHeight; - const rowCount = rows.length; - realRowIndex = 0; - output = ''; if (drawHorizontalLine(realRowIndex, rowCount)) { @@ -36,11 +32,10 @@ exports.default = (rows, border, columnSizeIndex, rowSpanIndex, drawHorizontalLi } rows.forEach((row, index0) => { - output += (0, _drawRow2.default)(row, border); + output += (0, _drawRow.default)(row, border); if (!rowHeight) { rowHeight = rowSpanIndex[realRowIndex]; - realRowIndex++; } @@ -56,4 +51,8 @@ exports.default = (rows, border, columnSizeIndex, rowSpanIndex, drawHorizontalLi } return output; -}; \ No newline at end of file +}; + +var _default = drawTable; +exports.default = _default; +//# sourceMappingURL=drawTable.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/drawTable.js.flow b/tools/node_modules/eslint/node_modules/table/dist/drawTable.js.flow new file mode 100644 index 00000000000000..15ad14cfa2ba12 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/drawTable.js.flow @@ -0,0 +1,52 @@ +import { + drawBorderTop, + drawBorderJoin, + drawBorderBottom +} from './drawBorder'; +import drawRow from './drawRow'; + +/** + * @param {Array} rows + * @param {Object} border + * @param {Array} columnSizeIndex + * @param {Array} rowSpanIndex + * @param {Function} drawHorizontalLine + * @returns {string} + */ +export default (rows, border, columnSizeIndex, rowSpanIndex, drawHorizontalLine) => { + let output; + let realRowIndex; + let rowHeight; + + const rowCount = rows.length; + + realRowIndex = 0; + + output = ''; + + if (drawHorizontalLine(realRowIndex, rowCount)) { + output += drawBorderTop(columnSizeIndex, border); + } + + rows.forEach((row, index0) => { + output += drawRow(row, border); + + if (!rowHeight) { + rowHeight = rowSpanIndex[realRowIndex]; + + realRowIndex++; + } + + rowHeight--; + + if (rowHeight === 0 && index0 !== rowCount - 1 && drawHorizontalLine(realRowIndex, rowCount)) { + output += drawBorderJoin(columnSizeIndex, border); + } + }); + + if (drawHorizontalLine(realRowIndex, rowCount)) { + output += drawBorderBottom(columnSizeIndex, border); + } + + return output; +}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/drawTable.js.map b/tools/node_modules/eslint/node_modules/table/dist/drawTable.js.map new file mode 100644 index 00000000000000..526336ab999159 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/drawTable.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/drawTable.js"],"names":["rows","border","columnSizeIndex","rowSpanIndex","drawHorizontalLine","output","realRowIndex","rowHeight","rowCount","length","forEach","row","index0"],"mappings":";;;;;;;AAAA;;AAKA;;;;AAEA;;;;;;;;mBAQgBA,I,EAAMC,M,EAAQC,e,EAAiBC,Y,EAAcC,kB,KAAuB;AAClF,MAAIC,MAAJ;AACA,MAAIC,YAAJ;AACA,MAAIC,SAAJ;AAEA,QAAMC,QAAQ,GAAGR,IAAI,CAACS,MAAtB;AAEAH,EAAAA,YAAY,GAAG,CAAf;AAEAD,EAAAA,MAAM,GAAG,EAAT;;AAEA,MAAID,kBAAkB,CAACE,YAAD,EAAeE,QAAf,CAAtB,EAAgD;AAC9CH,IAAAA,MAAM,IAAI,+BAAcH,eAAd,EAA+BD,MAA/B,CAAV;AACD;;AAEDD,EAAAA,IAAI,CAACU,OAAL,CAAa,CAACC,GAAD,EAAMC,MAAN,KAAiB;AAC5BP,IAAAA,MAAM,IAAI,sBAAQM,GAAR,EAAaV,MAAb,CAAV;;AAEA,QAAI,CAACM,SAAL,EAAgB;AACdA,MAAAA,SAAS,GAAGJ,YAAY,CAACG,YAAD,CAAxB;AAEAA,MAAAA,YAAY;AACb;;AAEDC,IAAAA,SAAS;;AAET,QAAIA,SAAS,KAAK,CAAd,IAAmBK,MAAM,KAAKJ,QAAQ,GAAG,CAAzC,IAA8CJ,kBAAkB,CAACE,YAAD,EAAeE,QAAf,CAApE,EAA8F;AAC5FH,MAAAA,MAAM,IAAI,gCAAeH,eAAf,EAAgCD,MAAhC,CAAV;AACD;AACF,GAdD;;AAgBA,MAAIG,kBAAkB,CAACE,YAAD,EAAeE,QAAf,CAAtB,EAAgD;AAC9CH,IAAAA,MAAM,IAAI,kCAAiBH,eAAjB,EAAkCD,MAAlC,CAAV;AACD;;AAED,SAAOI,MAAP;AACD,C","sourcesContent":["import {\n drawBorderTop,\n drawBorderJoin,\n drawBorderBottom\n} from './drawBorder';\nimport drawRow from './drawRow';\n\n/**\n * @param {Array} rows\n * @param {Object} border\n * @param {Array} columnSizeIndex\n * @param {Array} rowSpanIndex\n * @param {Function} drawHorizontalLine\n * @returns {string}\n */\nexport default (rows, border, columnSizeIndex, rowSpanIndex, drawHorizontalLine) => {\n let output;\n let realRowIndex;\n let rowHeight;\n\n const rowCount = rows.length;\n\n realRowIndex = 0;\n\n output = '';\n\n if (drawHorizontalLine(realRowIndex, rowCount)) {\n output += drawBorderTop(columnSizeIndex, border);\n }\n\n rows.forEach((row, index0) => {\n output += drawRow(row, border);\n\n if (!rowHeight) {\n rowHeight = rowSpanIndex[realRowIndex];\n\n realRowIndex++;\n }\n\n rowHeight--;\n\n if (rowHeight === 0 && index0 !== rowCount - 1 && drawHorizontalLine(realRowIndex, rowCount)) {\n output += drawBorderJoin(columnSizeIndex, border);\n }\n });\n\n if (drawHorizontalLine(realRowIndex, rowCount)) {\n output += drawBorderBottom(columnSizeIndex, border);\n }\n\n return output;\n};\n"],"file":"drawTable.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/getBorderCharacters.js b/tools/node_modules/eslint/node_modules/table/dist/getBorderCharacters.js index 0a0f599ca39242..0b9b5b00e10212 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/getBorderCharacters.js +++ b/tools/node_modules/eslint/node_modules/table/dist/getBorderCharacters.js @@ -1,8 +1,9 @@ -'use strict'; +"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = void 0; /* eslint-disable sort-keys */ @@ -29,23 +30,20 @@ Object.defineProperty(exports, "__esModule", { * @param {string} name * @returns {border} */ -exports.default = name => { +const getBorderCharacters = name => { if (name === 'honeywell') { return { topBody: '═', topJoin: '╤', topLeft: '╔', topRight: '╗', - bottomBody: '═', bottomJoin: '╧', bottomLeft: '╚', bottomRight: '╝', - bodyLeft: '║', bodyRight: '║', bodyJoin: '│', - joinBody: '─', joinLeft: '╟', joinRight: '╢', @@ -59,16 +57,13 @@ exports.default = name => { topJoin: '┬', topLeft: '┌', topRight: '┐', - bottomBody: '─', bottomJoin: '┴', bottomLeft: '└', bottomRight: '┘', - bodyLeft: '│', bodyRight: '│', bodyJoin: '│', - joinBody: '─', joinLeft: '├', joinRight: '┤', @@ -82,16 +77,13 @@ exports.default = name => { topJoin: '+', topLeft: '+', topRight: '+', - bottomBody: '-', bottomJoin: '+', bottomLeft: '+', bottomRight: '+', - bodyLeft: '|', bodyRight: '|', bodyJoin: '|', - joinBody: '-', joinLeft: '|', joinRight: '|', @@ -105,16 +97,13 @@ exports.default = name => { topJoin: '', topLeft: '', topRight: '', - bottomBody: '', bottomJoin: '', bottomLeft: '', bottomRight: '', - bodyLeft: '', bodyRight: '', bodyJoin: '', - joinBody: '', joinLeft: '', joinRight: '', @@ -123,4 +112,8 @@ exports.default = name => { } throw new Error('Unknown border template "' + name + '".'); -}; \ No newline at end of file +}; + +var _default = getBorderCharacters; +exports.default = _default; +//# sourceMappingURL=getBorderCharacters.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/getBorderCharacters.js.flow b/tools/node_modules/eslint/node_modules/table/dist/getBorderCharacters.js.flow new file mode 100644 index 00000000000000..916b3518f9408e --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/getBorderCharacters.js.flow @@ -0,0 +1,120 @@ +/* eslint-disable sort-keys */ + +/** + * @typedef border + * @property {string} topBody + * @property {string} topJoin + * @property {string} topLeft + * @property {string} topRight + * @property {string} bottomBody + * @property {string} bottomJoin + * @property {string} bottomLeft + * @property {string} bottomRight + * @property {string} bodyLeft + * @property {string} bodyRight + * @property {string} bodyJoin + * @property {string} joinBody + * @property {string} joinLeft + * @property {string} joinRight + * @property {string} joinJoin + */ + +/** + * @param {string} name + * @returns {border} + */ +export default (name) => { + if (name === 'honeywell') { + return { + topBody: '═', + topJoin: '╤', + topLeft: '╔', + topRight: '╗', + + bottomBody: '═', + bottomJoin: '╧', + bottomLeft: '╚', + bottomRight: '╝', + + bodyLeft: '║', + bodyRight: '║', + bodyJoin: '│', + + joinBody: '─', + joinLeft: '╟', + joinRight: '╢', + joinJoin: '┼' + }; + } + + if (name === 'norc') { + return { + topBody: '─', + topJoin: '┬', + topLeft: '┌', + topRight: '┐', + + bottomBody: '─', + bottomJoin: '┴', + bottomLeft: '└', + bottomRight: '┘', + + bodyLeft: '│', + bodyRight: '│', + bodyJoin: '│', + + joinBody: '─', + joinLeft: '├', + joinRight: '┤', + joinJoin: '┼' + }; + } + + if (name === 'ramac') { + return { + topBody: '-', + topJoin: '+', + topLeft: '+', + topRight: '+', + + bottomBody: '-', + bottomJoin: '+', + bottomLeft: '+', + bottomRight: '+', + + bodyLeft: '|', + bodyRight: '|', + bodyJoin: '|', + + joinBody: '-', + joinLeft: '|', + joinRight: '|', + joinJoin: '|' + }; + } + + if (name === 'void') { + return { + topBody: '', + topJoin: '', + topLeft: '', + topRight: '', + + bottomBody: '', + bottomJoin: '', + bottomLeft: '', + bottomRight: '', + + bodyLeft: '', + bodyRight: '', + bodyJoin: '', + + joinBody: '', + joinLeft: '', + joinRight: '', + joinJoin: '' + }; + } + + throw new Error('Unknown border template "' + name + '".'); +}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/getBorderCharacters.js.map b/tools/node_modules/eslint/node_modules/table/dist/getBorderCharacters.js.map new file mode 100644 index 00000000000000..543426cacf0160 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/getBorderCharacters.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/getBorderCharacters.js"],"names":["name","topBody","topJoin","topLeft","topRight","bottomBody","bottomJoin","bottomLeft","bottomRight","bodyLeft","bodyRight","bodyJoin","joinBody","joinLeft","joinRight","joinJoin","Error"],"mappings":";;;;;;;AAAA;;AAEA;;;;;;;;;;;;;;;;;;;AAmBA;;;;4BAIgBA,I,IAAS;AACvB,MAAIA,IAAI,KAAK,WAAb,EAA0B;AACxB,WAAO;AACLC,MAAAA,OAAO,EAAE,GADJ;AAELC,MAAAA,OAAO,EAAE,GAFJ;AAGLC,MAAAA,OAAO,EAAE,GAHJ;AAILC,MAAAA,QAAQ,EAAE,GAJL;AAMLC,MAAAA,UAAU,EAAE,GANP;AAOLC,MAAAA,UAAU,EAAE,GAPP;AAQLC,MAAAA,UAAU,EAAE,GARP;AASLC,MAAAA,WAAW,EAAE,GATR;AAWLC,MAAAA,QAAQ,EAAE,GAXL;AAYLC,MAAAA,SAAS,EAAE,GAZN;AAaLC,MAAAA,QAAQ,EAAE,GAbL;AAeLC,MAAAA,QAAQ,EAAE,GAfL;AAgBLC,MAAAA,QAAQ,EAAE,GAhBL;AAiBLC,MAAAA,SAAS,EAAE,GAjBN;AAkBLC,MAAAA,QAAQ,EAAE;AAlBL,KAAP;AAoBD;;AAED,MAAIf,IAAI,KAAK,MAAb,EAAqB;AACnB,WAAO;AACLC,MAAAA,OAAO,EAAE,GADJ;AAELC,MAAAA,OAAO,EAAE,GAFJ;AAGLC,MAAAA,OAAO,EAAE,GAHJ;AAILC,MAAAA,QAAQ,EAAE,GAJL;AAMLC,MAAAA,UAAU,EAAE,GANP;AAOLC,MAAAA,UAAU,EAAE,GAPP;AAQLC,MAAAA,UAAU,EAAE,GARP;AASLC,MAAAA,WAAW,EAAE,GATR;AAWLC,MAAAA,QAAQ,EAAE,GAXL;AAYLC,MAAAA,SAAS,EAAE,GAZN;AAaLC,MAAAA,QAAQ,EAAE,GAbL;AAeLC,MAAAA,QAAQ,EAAE,GAfL;AAgBLC,MAAAA,QAAQ,EAAE,GAhBL;AAiBLC,MAAAA,SAAS,EAAE,GAjBN;AAkBLC,MAAAA,QAAQ,EAAE;AAlBL,KAAP;AAoBD;;AAED,MAAIf,IAAI,KAAK,OAAb,EAAsB;AACpB,WAAO;AACLC,MAAAA,OAAO,EAAE,GADJ;AAELC,MAAAA,OAAO,EAAE,GAFJ;AAGLC,MAAAA,OAAO,EAAE,GAHJ;AAILC,MAAAA,QAAQ,EAAE,GAJL;AAMLC,MAAAA,UAAU,EAAE,GANP;AAOLC,MAAAA,UAAU,EAAE,GAPP;AAQLC,MAAAA,UAAU,EAAE,GARP;AASLC,MAAAA,WAAW,EAAE,GATR;AAWLC,MAAAA,QAAQ,EAAE,GAXL;AAYLC,MAAAA,SAAS,EAAE,GAZN;AAaLC,MAAAA,QAAQ,EAAE,GAbL;AAeLC,MAAAA,QAAQ,EAAE,GAfL;AAgBLC,MAAAA,QAAQ,EAAE,GAhBL;AAiBLC,MAAAA,SAAS,EAAE,GAjBN;AAkBLC,MAAAA,QAAQ,EAAE;AAlBL,KAAP;AAoBD;;AAED,MAAIf,IAAI,KAAK,MAAb,EAAqB;AACnB,WAAO;AACLC,MAAAA,OAAO,EAAE,EADJ;AAELC,MAAAA,OAAO,EAAE,EAFJ;AAGLC,MAAAA,OAAO,EAAE,EAHJ;AAILC,MAAAA,QAAQ,EAAE,EAJL;AAMLC,MAAAA,UAAU,EAAE,EANP;AAOLC,MAAAA,UAAU,EAAE,EAPP;AAQLC,MAAAA,UAAU,EAAE,EARP;AASLC,MAAAA,WAAW,EAAE,EATR;AAWLC,MAAAA,QAAQ,EAAE,EAXL;AAYLC,MAAAA,SAAS,EAAE,EAZN;AAaLC,MAAAA,QAAQ,EAAE,EAbL;AAeLC,MAAAA,QAAQ,EAAE,EAfL;AAgBLC,MAAAA,QAAQ,EAAE,EAhBL;AAiBLC,MAAAA,SAAS,EAAE,EAjBN;AAkBLC,MAAAA,QAAQ,EAAE;AAlBL,KAAP;AAoBD;;AAED,QAAM,IAAIC,KAAJ,CAAU,8BAA8BhB,IAA9B,GAAqC,IAA/C,CAAN;AACD,C","sourcesContent":["/* eslint-disable sort-keys */\n\n/**\n * @typedef border\n * @property {string} topBody\n * @property {string} topJoin\n * @property {string} topLeft\n * @property {string} topRight\n * @property {string} bottomBody\n * @property {string} bottomJoin\n * @property {string} bottomLeft\n * @property {string} bottomRight\n * @property {string} bodyLeft\n * @property {string} bodyRight\n * @property {string} bodyJoin\n * @property {string} joinBody\n * @property {string} joinLeft\n * @property {string} joinRight\n * @property {string} joinJoin\n */\n\n/**\n * @param {string} name\n * @returns {border}\n */\nexport default (name) => {\n if (name === 'honeywell') {\n return {\n topBody: '═',\n topJoin: '╤',\n topLeft: '╔',\n topRight: '╗',\n\n bottomBody: '═',\n bottomJoin: '╧',\n bottomLeft: '╚',\n bottomRight: '╝',\n\n bodyLeft: '║',\n bodyRight: '║',\n bodyJoin: '│',\n\n joinBody: '─',\n joinLeft: '╟',\n joinRight: '╢',\n joinJoin: '┼'\n };\n }\n\n if (name === 'norc') {\n return {\n topBody: '─',\n topJoin: '┬',\n topLeft: '┌',\n topRight: '┐',\n\n bottomBody: '─',\n bottomJoin: '┴',\n bottomLeft: '└',\n bottomRight: '┘',\n\n bodyLeft: '│',\n bodyRight: '│',\n bodyJoin: '│',\n\n joinBody: '─',\n joinLeft: '├',\n joinRight: '┤',\n joinJoin: '┼'\n };\n }\n\n if (name === 'ramac') {\n return {\n topBody: '-',\n topJoin: '+',\n topLeft: '+',\n topRight: '+',\n\n bottomBody: '-',\n bottomJoin: '+',\n bottomLeft: '+',\n bottomRight: '+',\n\n bodyLeft: '|',\n bodyRight: '|',\n bodyJoin: '|',\n\n joinBody: '-',\n joinLeft: '|',\n joinRight: '|',\n joinJoin: '|'\n };\n }\n\n if (name === 'void') {\n return {\n topBody: '',\n topJoin: '',\n topLeft: '',\n topRight: '',\n\n bottomBody: '',\n bottomJoin: '',\n bottomLeft: '',\n bottomRight: '',\n\n bodyLeft: '',\n bodyRight: '',\n bodyJoin: '',\n\n joinBody: '',\n joinLeft: '',\n joinRight: '',\n joinJoin: ''\n };\n }\n\n throw new Error('Unknown border template \"' + name + '\".');\n};\n"],"file":"getBorderCharacters.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/index.js b/tools/node_modules/eslint/node_modules/table/dist/index.js index 169eddf080bfb2..1f40e6628d67af 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/index.js +++ b/tools/node_modules/eslint/node_modules/table/dist/index.js @@ -1,24 +1,32 @@ -'use strict'; +"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.getBorderCharacters = exports.createStream = exports.table = undefined; - -var _table = require('./table'); - -var _table2 = _interopRequireDefault(_table); - -var _createStream = require('./createStream'); +Object.defineProperty(exports, "table", { + enumerable: true, + get: function get() { + return _table.default; + } +}); +Object.defineProperty(exports, "createStream", { + enumerable: true, + get: function get() { + return _createStream.default; + } +}); +Object.defineProperty(exports, "getBorderCharacters", { + enumerable: true, + get: function get() { + return _getBorderCharacters.default; + } +}); -var _createStream2 = _interopRequireDefault(_createStream); +var _table = _interopRequireDefault(require("./table")); -var _getBorderCharacters = require('./getBorderCharacters'); +var _createStream = _interopRequireDefault(require("./createStream")); -var _getBorderCharacters2 = _interopRequireDefault(_getBorderCharacters); +var _getBorderCharacters = _interopRequireDefault(require("./getBorderCharacters")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.table = _table2.default; -exports.createStream = _createStream2.default; -exports.getBorderCharacters = _getBorderCharacters2.default; \ No newline at end of file +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/index.js.flow b/tools/node_modules/eslint/node_modules/table/dist/index.js.flow new file mode 100644 index 00000000000000..76cd8301a0eac3 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/index.js.flow @@ -0,0 +1,9 @@ +import table from './table'; +import createStream from './createStream'; +import getBorderCharacters from './getBorderCharacters'; + +export { + table, + createStream, + getBorderCharacters +}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/index.js.map b/tools/node_modules/eslint/node_modules/table/dist/index.js.map new file mode 100644 index 00000000000000..2f59e09a1521bf --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA","sourcesContent":["import table from './table';\nimport createStream from './createStream';\nimport getBorderCharacters from './getBorderCharacters';\n\nexport {\n table,\n createStream,\n getBorderCharacters\n};\n"],"file":"index.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js b/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js index 9444ffe0e2bfa6..0ec93b8628161b 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js +++ b/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js @@ -1,24 +1,17 @@ -'use strict'; +"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = void 0; -var _lodash = require('lodash'); +var _lodash = _interopRequireDefault(require("lodash")); -var _lodash2 = _interopRequireDefault(_lodash); +var _getBorderCharacters = _interopRequireDefault(require("./getBorderCharacters")); -var _getBorderCharacters = require('./getBorderCharacters'); +var _validateConfig = _interopRequireDefault(require("./validateConfig")); -var _getBorderCharacters2 = _interopRequireDefault(_getBorderCharacters); - -var _validateConfig = require('./validateConfig'); - -var _validateConfig2 = _interopRequireDefault(_validateConfig); - -var _calculateMaximumColumnWidthIndex = require('./calculateMaximumColumnWidthIndex'); - -var _calculateMaximumColumnWidthIndex2 = _interopRequireDefault(_calculateMaximumColumnWidthIndex); +var _calculateMaximumColumnWidthIndex = _interopRequireDefault(require("./calculateMaximumColumnWidthIndex")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -28,12 +21,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * @param {Object} border * @returns {Object} */ -const makeBorder = function makeBorder() { - let border = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - return Object.assign({}, (0, _getBorderCharacters2.default)('honeywell'), border); +const makeBorder = (border = {}) => { + return Object.assign({}, (0, _getBorderCharacters.default)('honeywell'), border); }; - /** * Creates a configuration for every column using default * values for the missing configuration properties. @@ -43,14 +33,13 @@ const makeBorder = function makeBorder() { * @param {Object} columnDefault * @returns {Object} */ -const makeColumns = function makeColumns(rows) { - let columns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - let columnDefault = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - const maximumColumnWidthIndex = (0, _calculateMaximumColumnWidthIndex2.default)(rows); - _lodash2.default.times(rows[0].length, index => { - if (_lodash2.default.isUndefined(columns[index])) { +const makeColumns = (rows, columns = {}, columnDefault = {}) => { + const maximumColumnWidthIndex = (0, _calculateMaximumColumnWidthIndex.default)(rows); + + _lodash.default.times(rows[0].length, index => { + if (_lodash.default.isUndefined(columns[index])) { columns[index] = {}; } @@ -66,7 +55,6 @@ const makeColumns = function makeColumns(rows) { return columns; }; - /** * Makes a new configuration object out of the userConfig object * using default values for the missing configuration properties. @@ -76,12 +64,11 @@ const makeColumns = function makeColumns(rows) { * @returns {Object} */ -exports.default = function (rows) { - let userConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - (0, _validateConfig2.default)('config.json', userConfig); +const makeConfig = (rows, userConfig = {}) => { + (0, _validateConfig.default)('config.json', userConfig); - const config = _lodash2.default.cloneDeep(userConfig); + const config = _lodash.default.cloneDeep(userConfig); config.border = makeBorder(config.border); config.columns = makeColumns(rows, config.columns, config.columnDefault); @@ -96,4 +83,8 @@ exports.default = function (rows) { } return config; -}; \ No newline at end of file +}; + +var _default = makeConfig; +exports.default = _default; +//# sourceMappingURL=makeConfig.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js.flow b/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js.flow new file mode 100644 index 00000000000000..9a0ee0afade046 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js.flow @@ -0,0 +1,72 @@ +import _ from 'lodash'; +import getBorderCharacters from './getBorderCharacters'; +import validateConfig from './validateConfig'; +import calculateMaximumColumnWidthIndex from './calculateMaximumColumnWidthIndex'; + +/** + * Merges user provided border characters with the default border ("honeywell") characters. + * + * @param {Object} border + * @returns {Object} + */ +const makeBorder = (border = {}) => { + return Object.assign({}, getBorderCharacters('honeywell'), border); +}; + +/** + * Creates a configuration for every column using default + * values for the missing configuration properties. + * + * @param {Array[]} rows + * @param {Object} columns + * @param {Object} columnDefault + * @returns {Object} + */ +const makeColumns = (rows, columns = {}, columnDefault = {}) => { + const maximumColumnWidthIndex = calculateMaximumColumnWidthIndex(rows); + + _.times(rows[0].length, (index) => { + if (_.isUndefined(columns[index])) { + columns[index] = {}; + } + + columns[index] = Object.assign({ + alignment: 'left', + paddingLeft: 1, + paddingRight: 1, + truncate: Infinity, + width: maximumColumnWidthIndex[index], + wrapWord: false + }, columnDefault, columns[index]); + }); + + return columns; +}; + +/** + * Makes a new configuration object out of the userConfig object + * using default values for the missing configuration properties. + * + * @param {Array[]} rows + * @param {Object} userConfig + * @returns {Object} + */ +export default (rows, userConfig = {}) => { + validateConfig('config.json', userConfig); + + const config = _.cloneDeep(userConfig); + + config.border = makeBorder(config.border); + config.columns = makeColumns(rows, config.columns, config.columnDefault); + + if (!config.drawHorizontalLine) { + /** + * @returns {boolean} + */ + config.drawHorizontalLine = () => { + return true; + }; + } + + return config; +}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js.map b/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js.map new file mode 100644 index 00000000000000..91b0bdeb9a826e --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/makeConfig.js"],"names":["makeBorder","border","Object","assign","makeColumns","rows","columns","columnDefault","maximumColumnWidthIndex","_","times","length","index","isUndefined","alignment","paddingLeft","paddingRight","truncate","Infinity","width","wrapWord","userConfig","config","cloneDeep","drawHorizontalLine"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;AAEA;;;;;;AAMA,MAAMA,UAAU,GAAG,CAACC,MAAM,GAAG,EAAV,KAAiB;AAClC,SAAOC,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkB,kCAAoB,WAApB,CAAlB,EAAoDF,MAApD,CAAP;AACD,CAFD;AAIA;;;;;;;;;;;AASA,MAAMG,WAAW,GAAG,CAACC,IAAD,EAAOC,OAAO,GAAG,EAAjB,EAAqBC,aAAa,GAAG,EAArC,KAA4C;AAC9D,QAAMC,uBAAuB,GAAG,+CAAiCH,IAAjC,CAAhC;;AAEAI,kBAAEC,KAAF,CAAQL,IAAI,CAAC,CAAD,CAAJ,CAAQM,MAAhB,EAAyBC,KAAD,IAAW;AACjC,QAAIH,gBAAEI,WAAF,CAAcP,OAAO,CAACM,KAAD,CAArB,CAAJ,EAAmC;AACjCN,MAAAA,OAAO,CAACM,KAAD,CAAP,GAAiB,EAAjB;AACD;;AAEDN,IAAAA,OAAO,CAACM,KAAD,CAAP,GAAiBV,MAAM,CAACC,MAAP,CAAc;AAC7BW,MAAAA,SAAS,EAAE,MADkB;AAE7BC,MAAAA,WAAW,EAAE,CAFgB;AAG7BC,MAAAA,YAAY,EAAE,CAHe;AAI7BC,MAAAA,QAAQ,EAAEC,QAJmB;AAK7BC,MAAAA,KAAK,EAAEX,uBAAuB,CAACI,KAAD,CALD;AAM7BQ,MAAAA,QAAQ,EAAE;AANmB,KAAd,EAOdb,aAPc,EAOCD,OAAO,CAACM,KAAD,CAPR,CAAjB;AAQD,GAbD;;AAeA,SAAON,OAAP;AACD,CAnBD;AAqBA;;;;;;;;;;oBAQgBD,I,EAAMgB,UAAU,GAAG,E,KAAO;AACxC,+BAAe,aAAf,EAA8BA,UAA9B;;AAEA,QAAMC,MAAM,GAAGb,gBAAEc,SAAF,CAAYF,UAAZ,CAAf;;AAEAC,EAAAA,MAAM,CAACrB,MAAP,GAAgBD,UAAU,CAACsB,MAAM,CAACrB,MAAR,CAA1B;AACAqB,EAAAA,MAAM,CAAChB,OAAP,GAAiBF,WAAW,CAACC,IAAD,EAAOiB,MAAM,CAAChB,OAAd,EAAuBgB,MAAM,CAACf,aAA9B,CAA5B;;AAEA,MAAI,CAACe,MAAM,CAACE,kBAAZ,EAAgC;AAC9B;;;AAGAF,IAAAA,MAAM,CAACE,kBAAP,GAA4B,MAAM;AAChC,aAAO,IAAP;AACD,KAFD;AAGD;;AAED,SAAOF,MAAP;AACD,C","sourcesContent":["import _ from 'lodash';\nimport getBorderCharacters from './getBorderCharacters';\nimport validateConfig from './validateConfig';\nimport calculateMaximumColumnWidthIndex from './calculateMaximumColumnWidthIndex';\n\n/**\n * Merges user provided border characters with the default border (\"honeywell\") characters.\n *\n * @param {Object} border\n * @returns {Object}\n */\nconst makeBorder = (border = {}) => {\n return Object.assign({}, getBorderCharacters('honeywell'), border);\n};\n\n/**\n * Creates a configuration for every column using default\n * values for the missing configuration properties.\n *\n * @param {Array[]} rows\n * @param {Object} columns\n * @param {Object} columnDefault\n * @returns {Object}\n */\nconst makeColumns = (rows, columns = {}, columnDefault = {}) => {\n const maximumColumnWidthIndex = calculateMaximumColumnWidthIndex(rows);\n\n _.times(rows[0].length, (index) => {\n if (_.isUndefined(columns[index])) {\n columns[index] = {};\n }\n\n columns[index] = Object.assign({\n alignment: 'left',\n paddingLeft: 1,\n paddingRight: 1,\n truncate: Infinity,\n width: maximumColumnWidthIndex[index],\n wrapWord: false\n }, columnDefault, columns[index]);\n });\n\n return columns;\n};\n\n/**\n * Makes a new configuration object out of the userConfig object\n * using default values for the missing configuration properties.\n *\n * @param {Array[]} rows\n * @param {Object} userConfig\n * @returns {Object}\n */\nexport default (rows, userConfig = {}) => {\n validateConfig('config.json', userConfig);\n\n const config = _.cloneDeep(userConfig);\n\n config.border = makeBorder(config.border);\n config.columns = makeColumns(rows, config.columns, config.columnDefault);\n\n if (!config.drawHorizontalLine) {\n /**\n * @returns {boolean}\n */\n config.drawHorizontalLine = () => {\n return true;\n };\n }\n\n return config;\n};\n"],"file":"makeConfig.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js b/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js index 479de35a7c9777..131c200c01e712 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js +++ b/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js @@ -1,20 +1,15 @@ -'use strict'; +"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = void 0; -var _lodash = require('lodash'); +var _lodash = _interopRequireDefault(require("lodash")); -var _lodash2 = _interopRequireDefault(_lodash); +var _getBorderCharacters = _interopRequireDefault(require("./getBorderCharacters")); -var _getBorderCharacters = require('./getBorderCharacters'); - -var _getBorderCharacters2 = _interopRequireDefault(_getBorderCharacters); - -var _validateConfig = require('./validateConfig'); - -var _validateConfig2 = _interopRequireDefault(_validateConfig); +var _validateConfig = _interopRequireDefault(require("./validateConfig")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -24,12 +19,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * @param {Object} border * @returns {Object} */ -const makeBorder = function makeBorder() { - let border = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - return Object.assign({}, (0, _getBorderCharacters2.default)('honeywell'), border); +const makeBorder = (border = {}) => { + return Object.assign({}, (0, _getBorderCharacters.default)('honeywell'), border); }; - /** * Creates a configuration for every column using default * values for the missing configuration properties. @@ -39,12 +31,11 @@ const makeBorder = function makeBorder() { * @param {Object} columnDefault * @returns {Object} */ -const makeColumns = function makeColumns(columnCount) { - let columns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - let columnDefault = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - _lodash2.default.times(columnCount, index => { - if (_lodash2.default.isUndefined(columns[index])) { + +const makeColumns = (columnCount, columns = {}, columnDefault = {}) => { + _lodash.default.times(columnCount, index => { + if (_lodash.default.isUndefined(columns[index])) { columns[index] = {}; } @@ -59,7 +50,6 @@ const makeColumns = function makeColumns(columnCount) { return columns; }; - /** * @typedef {Object} columnConfig * @property {string} alignment @@ -85,12 +75,11 @@ const makeColumns = function makeColumns(columnCount) { * @returns {Object} */ -exports.default = function () { - let userConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - (0, _validateConfig2.default)('streamConfig.json', userConfig); +const makeStreamConfig = (userConfig = {}) => { + (0, _validateConfig.default)('streamConfig.json', userConfig); - const config = _lodash2.default.cloneDeep(userConfig); + const config = _lodash.default.cloneDeep(userConfig); if (!config.columnDefault || !config.columnDefault.width) { throw new Error('Must provide config.columnDefault.width when creating a stream.'); @@ -102,6 +91,9 @@ exports.default = function () { config.border = makeBorder(config.border); config.columns = makeColumns(config.columnCount, config.columns, config.columnDefault); - return config; -}; \ No newline at end of file +}; + +var _default = makeStreamConfig; +exports.default = _default; +//# sourceMappingURL=makeStreamConfig.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js.flow b/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js.flow new file mode 100644 index 00000000000000..884625a53bb3a0 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js.flow @@ -0,0 +1,83 @@ +import _ from 'lodash'; +import getBorderCharacters from './getBorderCharacters'; +import validateConfig from './validateConfig'; + +/** + * Merges user provided border characters with the default border ("honeywell") characters. + * + * @param {Object} border + * @returns {Object} + */ +const makeBorder = (border = {}) => { + return Object.assign({}, getBorderCharacters('honeywell'), border); +}; + +/** + * Creates a configuration for every column using default + * values for the missing configuration properties. + * + * @param {number} columnCount + * @param {Object} columns + * @param {Object} columnDefault + * @returns {Object} + */ +const makeColumns = (columnCount, columns = {}, columnDefault = {}) => { + _.times(columnCount, (index) => { + if (_.isUndefined(columns[index])) { + columns[index] = {}; + } + + columns[index] = Object.assign({ + alignment: 'left', + paddingLeft: 1, + paddingRight: 1, + truncate: Infinity, + wrapWord: false + }, columnDefault, columns[index]); + }); + + return columns; +}; + +/** + * @typedef {Object} columnConfig + * @property {string} alignment + * @property {number} width + * @property {number} truncate + * @property {number} paddingLeft + * @property {number} paddingRight + */ + +/** + * @typedef {Object} streamConfig + * @property {columnConfig} columnDefault + * @property {Object} border + * @property {columnConfig[]} + * @property {number} columnCount Number of columns in the table (required). + */ + +/** + * Makes a new configuration object out of the userConfig object + * using default values for the missing configuration properties. + * + * @param {streamConfig} userConfig + * @returns {Object} + */ +export default (userConfig = {}) => { + validateConfig('streamConfig.json', userConfig); + + const config = _.cloneDeep(userConfig); + + if (!config.columnDefault || !config.columnDefault.width) { + throw new Error('Must provide config.columnDefault.width when creating a stream.'); + } + + if (!config.columnCount) { + throw new Error('Must provide config.columnCount.'); + } + + config.border = makeBorder(config.border); + config.columns = makeColumns(config.columnCount, config.columns, config.columnDefault); + + return config; +}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js.map b/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js.map new file mode 100644 index 00000000000000..a0a52ddae04ae7 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/makeStreamConfig.js"],"names":["makeBorder","border","Object","assign","makeColumns","columnCount","columns","columnDefault","_","times","index","isUndefined","alignment","paddingLeft","paddingRight","truncate","Infinity","wrapWord","userConfig","config","cloneDeep","width","Error"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;AAEA;;;;;;AAMA,MAAMA,UAAU,GAAG,CAACC,MAAM,GAAG,EAAV,KAAiB;AAClC,SAAOC,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkB,kCAAoB,WAApB,CAAlB,EAAoDF,MAApD,CAAP;AACD,CAFD;AAIA;;;;;;;;;;;AASA,MAAMG,WAAW,GAAG,CAACC,WAAD,EAAcC,OAAO,GAAG,EAAxB,EAA4BC,aAAa,GAAG,EAA5C,KAAmD;AACrEC,kBAAEC,KAAF,CAAQJ,WAAR,EAAsBK,KAAD,IAAW;AAC9B,QAAIF,gBAAEG,WAAF,CAAcL,OAAO,CAACI,KAAD,CAArB,CAAJ,EAAmC;AACjCJ,MAAAA,OAAO,CAACI,KAAD,CAAP,GAAiB,EAAjB;AACD;;AAEDJ,IAAAA,OAAO,CAACI,KAAD,CAAP,GAAiBR,MAAM,CAACC,MAAP,CAAc;AAC7BS,MAAAA,SAAS,EAAE,MADkB;AAE7BC,MAAAA,WAAW,EAAE,CAFgB;AAG7BC,MAAAA,YAAY,EAAE,CAHe;AAI7BC,MAAAA,QAAQ,EAAEC,QAJmB;AAK7BC,MAAAA,QAAQ,EAAE;AALmB,KAAd,EAMdV,aANc,EAMCD,OAAO,CAACI,KAAD,CANR,CAAjB;AAOD,GAZD;;AAcA,SAAOJ,OAAP;AACD,CAhBD;AAkBA;;;;;;;;;AASA;;;;;;;;AAQA;;;;;;;;;0BAOgBY,UAAU,GAAG,E,KAAO;AAClC,+BAAe,mBAAf,EAAoCA,UAApC;;AAEA,QAAMC,MAAM,GAAGX,gBAAEY,SAAF,CAAYF,UAAZ,CAAf;;AAEA,MAAI,CAACC,MAAM,CAACZ,aAAR,IAAyB,CAACY,MAAM,CAACZ,aAAP,CAAqBc,KAAnD,EAA0D;AACxD,UAAM,IAAIC,KAAJ,CAAU,iEAAV,CAAN;AACD;;AAED,MAAI,CAACH,MAAM,CAACd,WAAZ,EAAyB;AACvB,UAAM,IAAIiB,KAAJ,CAAU,kCAAV,CAAN;AACD;;AAEDH,EAAAA,MAAM,CAAClB,MAAP,GAAgBD,UAAU,CAACmB,MAAM,CAAClB,MAAR,CAA1B;AACAkB,EAAAA,MAAM,CAACb,OAAP,GAAiBF,WAAW,CAACe,MAAM,CAACd,WAAR,EAAqBc,MAAM,CAACb,OAA5B,EAAqCa,MAAM,CAACZ,aAA5C,CAA5B;AAEA,SAAOY,MAAP;AACD,C","sourcesContent":["import _ from 'lodash';\nimport getBorderCharacters from './getBorderCharacters';\nimport validateConfig from './validateConfig';\n\n/**\n * Merges user provided border characters with the default border (\"honeywell\") characters.\n *\n * @param {Object} border\n * @returns {Object}\n */\nconst makeBorder = (border = {}) => {\n return Object.assign({}, getBorderCharacters('honeywell'), border);\n};\n\n/**\n * Creates a configuration for every column using default\n * values for the missing configuration properties.\n *\n * @param {number} columnCount\n * @param {Object} columns\n * @param {Object} columnDefault\n * @returns {Object}\n */\nconst makeColumns = (columnCount, columns = {}, columnDefault = {}) => {\n _.times(columnCount, (index) => {\n if (_.isUndefined(columns[index])) {\n columns[index] = {};\n }\n\n columns[index] = Object.assign({\n alignment: 'left',\n paddingLeft: 1,\n paddingRight: 1,\n truncate: Infinity,\n wrapWord: false\n }, columnDefault, columns[index]);\n });\n\n return columns;\n};\n\n/**\n * @typedef {Object} columnConfig\n * @property {string} alignment\n * @property {number} width\n * @property {number} truncate\n * @property {number} paddingLeft\n * @property {number} paddingRight\n */\n\n/**\n * @typedef {Object} streamConfig\n * @property {columnConfig} columnDefault\n * @property {Object} border\n * @property {columnConfig[]}\n * @property {number} columnCount Number of columns in the table (required).\n */\n\n/**\n * Makes a new configuration object out of the userConfig object\n * using default values for the missing configuration properties.\n *\n * @param {streamConfig} userConfig\n * @returns {Object}\n */\nexport default (userConfig = {}) => {\n validateConfig('streamConfig.json', userConfig);\n\n const config = _.cloneDeep(userConfig);\n\n if (!config.columnDefault || !config.columnDefault.width) {\n throw new Error('Must provide config.columnDefault.width when creating a stream.');\n }\n\n if (!config.columnCount) {\n throw new Error('Must provide config.columnCount.');\n }\n\n config.border = makeBorder(config.border);\n config.columns = makeColumns(config.columnCount, config.columns, config.columnDefault);\n\n return config;\n};\n"],"file":"makeStreamConfig.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js b/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js index be0aae4e98ad42..8a7a16e2ce2f22 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js +++ b/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js @@ -1,20 +1,15 @@ -'use strict'; +"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = void 0; -var _lodash = require('lodash'); +var _lodash = _interopRequireDefault(require("lodash")); -var _lodash2 = _interopRequireDefault(_lodash); +var _wrapString = _interopRequireDefault(require("./wrapString")); -var _wrapString = require('./wrapString'); - -var _wrapString2 = _interopRequireDefault(_wrapString); - -var _wrapWord = require('./wrapWord'); - -var _wrapWord2 = _interopRequireDefault(_wrapWord); +var _wrapWord = _interopRequireDefault(require("./wrapWord")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -24,34 +19,34 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * @param {Object} config * @returns {Array} */ -exports.default = (unmappedRows, rowHeightIndex, config) => { +const mapDataUsingRowHeightIndex = (unmappedRows, rowHeightIndex, config) => { const tableWidth = unmappedRows[0].length; - const mappedRows = unmappedRows.map((cells, index0) => { - const rowHeight = _lodash2.default.times(rowHeightIndex[index0], () => { - return Array(tableWidth).fill(''); - }); - - // rowHeight + const rowHeight = _lodash.default.times(rowHeightIndex[index0], () => { + return new Array(tableWidth).fill(''); + }); // rowHeight // [{row index within rowSaw; index2}] // [{cell index within a virtual row; index1}] + cells.forEach((value, index1) => { let chunkedValue; if (config.columns[index1].wrapWord) { - chunkedValue = (0, _wrapWord2.default)(value, config.columns[index1].width); + chunkedValue = (0, _wrapWord.default)(value, config.columns[index1].width); } else { - chunkedValue = (0, _wrapString2.default)(value, config.columns[index1].width); + chunkedValue = (0, _wrapString.default)(value, config.columns[index1].width); } chunkedValue.forEach((part, index2) => { rowHeight[index2][index1] = part; }); }); - return rowHeight; }); + return _lodash.default.flatten(mappedRows); +}; - return _lodash2.default.flatten(mappedRows); -}; \ No newline at end of file +var _default = mapDataUsingRowHeightIndex; +exports.default = _default; +//# sourceMappingURL=mapDataUsingRowHeightIndex.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow b/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow new file mode 100644 index 00000000000000..89f1869b5daa8a --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow @@ -0,0 +1,41 @@ +import _ from 'lodash'; +import wrapString from './wrapString'; +import wrapWord from './wrapWord'; + +/** + * @param {Array} unmappedRows + * @param {number[]} rowHeightIndex + * @param {Object} config + * @returns {Array} + */ +export default (unmappedRows, rowHeightIndex, config) => { + const tableWidth = unmappedRows[0].length; + + const mappedRows = unmappedRows.map((cells, index0) => { + const rowHeight = _.times(rowHeightIndex[index0], () => { + return new Array(tableWidth).fill(''); + }); + + // rowHeight + // [{row index within rowSaw; index2}] + // [{cell index within a virtual row; index1}] + + cells.forEach((value, index1) => { + let chunkedValue; + + if (config.columns[index1].wrapWord) { + chunkedValue = wrapWord(value, config.columns[index1].width); + } else { + chunkedValue = wrapString(value, config.columns[index1].width); + } + + chunkedValue.forEach((part, index2) => { + rowHeight[index2][index1] = part; + }); + }); + + return rowHeight; + }); + + return _.flatten(mappedRows); +}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.map b/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.map new file mode 100644 index 00000000000000..3c1cd9844899ed --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/mapDataUsingRowHeightIndex.js"],"names":["unmappedRows","rowHeightIndex","config","tableWidth","length","mappedRows","map","cells","index0","rowHeight","_","times","Array","fill","forEach","value","index1","chunkedValue","columns","wrapWord","width","part","index2","flatten"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;AAEA;;;;;;oCAMgBA,Y,EAAcC,c,EAAgBC,M,KAAW;AACvD,QAAMC,UAAU,GAAGH,YAAY,CAAC,CAAD,CAAZ,CAAgBI,MAAnC;AAEA,QAAMC,UAAU,GAAGL,YAAY,CAACM,GAAb,CAAiB,CAACC,KAAD,EAAQC,MAAR,KAAmB;AACrD,UAAMC,SAAS,GAAGC,gBAAEC,KAAF,CAAQV,cAAc,CAACO,MAAD,CAAtB,EAAgC,MAAM;AACtD,aAAO,IAAII,KAAJ,CAAUT,UAAV,EAAsBU,IAAtB,CAA2B,EAA3B,CAAP;AACD,KAFiB,CAAlB,CADqD,CAKrD;AACA;AACA;;;AAEAN,IAAAA,KAAK,CAACO,OAAN,CAAc,CAACC,KAAD,EAAQC,MAAR,KAAmB;AAC/B,UAAIC,YAAJ;;AAEA,UAAIf,MAAM,CAACgB,OAAP,CAAeF,MAAf,EAAuBG,QAA3B,EAAqC;AACnCF,QAAAA,YAAY,GAAG,uBAASF,KAAT,EAAgBb,MAAM,CAACgB,OAAP,CAAeF,MAAf,EAAuBI,KAAvC,CAAf;AACD,OAFD,MAEO;AACLH,QAAAA,YAAY,GAAG,yBAAWF,KAAX,EAAkBb,MAAM,CAACgB,OAAP,CAAeF,MAAf,EAAuBI,KAAzC,CAAf;AACD;;AAEDH,MAAAA,YAAY,CAACH,OAAb,CAAqB,CAACO,IAAD,EAAOC,MAAP,KAAkB;AACrCb,QAAAA,SAAS,CAACa,MAAD,CAAT,CAAkBN,MAAlB,IAA4BK,IAA5B;AACD,OAFD;AAGD,KAZD;AAcA,WAAOZ,SAAP;AACD,GAxBkB,CAAnB;AA0BA,SAAOC,gBAAEa,OAAF,CAAUlB,UAAV,CAAP;AACD,C","sourcesContent":["import _ from 'lodash';\nimport wrapString from './wrapString';\nimport wrapWord from './wrapWord';\n\n/**\n * @param {Array} unmappedRows\n * @param {number[]} rowHeightIndex\n * @param {Object} config\n * @returns {Array}\n */\nexport default (unmappedRows, rowHeightIndex, config) => {\n const tableWidth = unmappedRows[0].length;\n\n const mappedRows = unmappedRows.map((cells, index0) => {\n const rowHeight = _.times(rowHeightIndex[index0], () => {\n return new Array(tableWidth).fill('');\n });\n\n // rowHeight\n // [{row index within rowSaw; index2}]\n // [{cell index within a virtual row; index1}]\n\n cells.forEach((value, index1) => {\n let chunkedValue;\n\n if (config.columns[index1].wrapWord) {\n chunkedValue = wrapWord(value, config.columns[index1].width);\n } else {\n chunkedValue = wrapString(value, config.columns[index1].width);\n }\n\n chunkedValue.forEach((part, index2) => {\n rowHeight[index2][index1] = part;\n });\n });\n\n return rowHeight;\n });\n\n return _.flatten(mappedRows);\n};\n"],"file":"mapDataUsingRowHeightIndex.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/padTableData.js b/tools/node_modules/eslint/node_modules/table/dist/padTableData.js index a78ce49bb1b624..81bd5f5d4ea03c 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/padTableData.js +++ b/tools/node_modules/eslint/node_modules/table/dist/padTableData.js @@ -1,20 +1,24 @@ -'use strict'; +"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = void 0; /** * @param {table~row[]} rows * @param {Object} config * @returns {table~row[]} */ -exports.default = (rows, config) => { +const padTableData = (rows, config) => { return rows.map(cells => { return cells.map((value, index1) => { const column = config.columns[index1]; - return ' '.repeat(column.paddingLeft) + value + ' '.repeat(column.paddingRight); }); }); -}; \ No newline at end of file +}; + +var _default = padTableData; +exports.default = _default; +//# sourceMappingURL=padTableData.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/padTableData.js.flow b/tools/node_modules/eslint/node_modules/table/dist/padTableData.js.flow new file mode 100644 index 00000000000000..f23dc021076099 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/padTableData.js.flow @@ -0,0 +1,14 @@ +/** + * @param {table~row[]} rows + * @param {Object} config + * @returns {table~row[]} + */ +export default (rows, config) => { + return rows.map((cells) => { + return cells.map((value, index1) => { + const column = config.columns[index1]; + + return ' '.repeat(column.paddingLeft) + value + ' '.repeat(column.paddingRight); + }); + }); +}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/padTableData.js.map b/tools/node_modules/eslint/node_modules/table/dist/padTableData.js.map new file mode 100644 index 00000000000000..783f9cc2fb96da --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/padTableData.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/padTableData.js"],"names":["rows","config","map","cells","value","index1","column","columns","repeat","paddingLeft","paddingRight"],"mappings":";;;;;;;AAAA;;;;;sBAKgBA,I,EAAMC,M,KAAW;AAC/B,SAAOD,IAAI,CAACE,GAAL,CAAUC,KAAD,IAAW;AACzB,WAAOA,KAAK,CAACD,GAAN,CAAU,CAACE,KAAD,EAAQC,MAAR,KAAmB;AAClC,YAAMC,MAAM,GAAGL,MAAM,CAACM,OAAP,CAAeF,MAAf,CAAf;AAEA,aAAO,IAAIG,MAAJ,CAAWF,MAAM,CAACG,WAAlB,IAAiCL,KAAjC,GAAyC,IAAII,MAAJ,CAAWF,MAAM,CAACI,YAAlB,CAAhD;AACD,KAJM,CAAP;AAKD,GANM,CAAP;AAOD,C","sourcesContent":["/**\n * @param {table~row[]} rows\n * @param {Object} config\n * @returns {table~row[]}\n */\nexport default (rows, config) => {\n return rows.map((cells) => {\n return cells.map((value, index1) => {\n const column = config.columns[index1];\n\n return ' '.repeat(column.paddingLeft) + value + ' '.repeat(column.paddingRight);\n });\n });\n};\n"],"file":"padTableData.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/schemas/config.json b/tools/node_modules/eslint/node_modules/table/dist/schemas/config.json index 36074181494ce1..1a4a9981833029 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/schemas/config.json +++ b/tools/node_modules/eslint/node_modules/table/dist/schemas/config.json @@ -1,6 +1,6 @@ { "$id": "config.json", - "$schema": "http://json-schema.org/draft-06/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "border": { diff --git a/tools/node_modules/eslint/node_modules/table/dist/schemas/streamConfig.json b/tools/node_modules/eslint/node_modules/table/dist/schemas/streamConfig.json index d8402a6248e2bd..35199844fd433e 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/schemas/streamConfig.json +++ b/tools/node_modules/eslint/node_modules/table/dist/schemas/streamConfig.json @@ -1,6 +1,6 @@ { "$id": "streamConfig.json", - "$schema": "http://json-schema.org/draft-06/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "border": { diff --git a/tools/node_modules/eslint/node_modules/table/dist/stringifyTableData.js b/tools/node_modules/eslint/node_modules/table/dist/stringifyTableData.js index 46a8b94a397633..0217e3b7b1f376 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/stringifyTableData.js +++ b/tools/node_modules/eslint/node_modules/table/dist/stringifyTableData.js @@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = void 0; /** * Casts all cell values to a string. @@ -10,8 +11,12 @@ Object.defineProperty(exports, "__esModule", { * @param {table~row[]} rows * @returns {table~row[]} */ -exports.default = rows => { +const stringifyTableData = rows => { return rows.map(cells => { return cells.map(String); }); -}; \ No newline at end of file +}; + +var _default = stringifyTableData; +exports.default = _default; +//# sourceMappingURL=stringifyTableData.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/stringifyTableData.js.flow b/tools/node_modules/eslint/node_modules/table/dist/stringifyTableData.js.flow new file mode 100644 index 00000000000000..a4dffac13d9be6 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/stringifyTableData.js.flow @@ -0,0 +1,11 @@ +/** + * Casts all cell values to a string. + * + * @param {table~row[]} rows + * @returns {table~row[]} + */ +export default (rows) => { + return rows.map((cells) => { + return cells.map(String); + }); +}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/stringifyTableData.js.map b/tools/node_modules/eslint/node_modules/table/dist/stringifyTableData.js.map new file mode 100644 index 00000000000000..6cbe5a71f3c427 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/stringifyTableData.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/stringifyTableData.js"],"names":["rows","map","cells","String"],"mappings":";;;;;;;AAAA;;;;;;2BAMgBA,I,IAAS;AACvB,SAAOA,IAAI,CAACC,GAAL,CAAUC,KAAD,IAAW;AACzB,WAAOA,KAAK,CAACD,GAAN,CAAUE,MAAV,CAAP;AACD,GAFM,CAAP;AAGD,C","sourcesContent":["/**\n * Casts all cell values to a string.\n *\n * @param {table~row[]} rows\n * @returns {table~row[]}\n */\nexport default (rows) => {\n return rows.map((cells) => {\n return cells.map(String);\n });\n};\n"],"file":"stringifyTableData.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/table.js b/tools/node_modules/eslint/node_modules/table/dist/table.js index fe8c3cfeb1b750..b4aac0167e3deb 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/table.js +++ b/tools/node_modules/eslint/node_modules/table/dist/table.js @@ -1,48 +1,29 @@ -'use strict'; +"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = void 0; -var _drawTable = require('./drawTable'); +var _drawTable = _interopRequireDefault(require("./drawTable")); -var _drawTable2 = _interopRequireDefault(_drawTable); +var _calculateCellWidthIndex = _interopRequireDefault(require("./calculateCellWidthIndex")); -var _calculateCellWidthIndex = require('./calculateCellWidthIndex'); +var _makeConfig = _interopRequireDefault(require("./makeConfig")); -var _calculateCellWidthIndex2 = _interopRequireDefault(_calculateCellWidthIndex); +var _calculateRowHeightIndex = _interopRequireDefault(require("./calculateRowHeightIndex")); -var _makeConfig = require('./makeConfig'); +var _mapDataUsingRowHeightIndex = _interopRequireDefault(require("./mapDataUsingRowHeightIndex")); -var _makeConfig2 = _interopRequireDefault(_makeConfig); +var _alignTableData = _interopRequireDefault(require("./alignTableData")); -var _calculateRowHeightIndex = require('./calculateRowHeightIndex'); +var _padTableData = _interopRequireDefault(require("./padTableData")); -var _calculateRowHeightIndex2 = _interopRequireDefault(_calculateRowHeightIndex); +var _validateTableData = _interopRequireDefault(require("./validateTableData")); -var _mapDataUsingRowHeightIndex = require('./mapDataUsingRowHeightIndex'); +var _stringifyTableData = _interopRequireDefault(require("./stringifyTableData")); -var _mapDataUsingRowHeightIndex2 = _interopRequireDefault(_mapDataUsingRowHeightIndex); - -var _alignTableData = require('./alignTableData'); - -var _alignTableData2 = _interopRequireDefault(_alignTableData); - -var _padTableData = require('./padTableData'); - -var _padTableData2 = _interopRequireDefault(_padTableData); - -var _validateTableData = require('./validateTableData'); - -var _validateTableData2 = _interopRequireDefault(_validateTableData); - -var _stringifyTableData = require('./stringifyTableData'); - -var _stringifyTableData2 = _interopRequireDefault(_stringifyTableData); - -var _truncateTableData = require('./truncateTableData'); - -var _truncateTableData2 = _interopRequireDefault(_truncateTableData); +var _truncateTableData = _interopRequireDefault(require("./truncateTableData")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -59,6 +40,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * @property {string} alignment Cell content alignment (enum: left, center, right) (default: left). * @property {number} width Column width (default: auto). * @property {number} truncate Number of characters are which the content will be truncated (default: Infinity). + * @property {boolean} wrapWord When true the text is broken at the nearest space or one of the special characters * @property {number} paddingLeft Cell content padding width left (default: 1). * @property {number} paddingRight Cell content padding width right (default: 1). */ @@ -108,26 +90,20 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * @param {table~config} userConfig * @returns {string} */ -exports.default = function (data) { - let userConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - +const table = (data, userConfig = {}) => { let rows; - - (0, _validateTableData2.default)(data); - - rows = (0, _stringifyTableData2.default)(data); - - const config = (0, _makeConfig2.default)(rows, userConfig); - - rows = (0, _truncateTableData2.default)(data, config); - - const rowHeightIndex = (0, _calculateRowHeightIndex2.default)(rows, config); - - rows = (0, _mapDataUsingRowHeightIndex2.default)(rows, rowHeightIndex, config); - rows = (0, _alignTableData2.default)(rows, config); - rows = (0, _padTableData2.default)(rows, config); - - const cellWidthIndex = (0, _calculateCellWidthIndex2.default)(rows[0]); - - return (0, _drawTable2.default)(rows, config.border, cellWidthIndex, rowHeightIndex, config.drawHorizontalLine); -}; \ No newline at end of file + (0, _validateTableData.default)(data); + rows = (0, _stringifyTableData.default)(data); + const config = (0, _makeConfig.default)(rows, userConfig); + rows = (0, _truncateTableData.default)(data, config); + const rowHeightIndex = (0, _calculateRowHeightIndex.default)(rows, config); + rows = (0, _mapDataUsingRowHeightIndex.default)(rows, rowHeightIndex, config); + rows = (0, _alignTableData.default)(rows, config); + rows = (0, _padTableData.default)(rows, config); + const cellWidthIndex = (0, _calculateCellWidthIndex.default)(rows[0]); + return (0, _drawTable.default)(rows, config.border, cellWidthIndex, rowHeightIndex, config.drawHorizontalLine); +}; + +var _default = table; +exports.default = _default; +//# sourceMappingURL=table.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/table.js.flow b/tools/node_modules/eslint/node_modules/table/dist/table.js.flow new file mode 100644 index 00000000000000..1b68a51a29488e --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/table.js.flow @@ -0,0 +1,95 @@ +import drawTable from './drawTable'; +import calculateCellWidthIndex from './calculateCellWidthIndex'; +import makeConfig from './makeConfig'; +import calculateRowHeightIndex from './calculateRowHeightIndex'; +import mapDataUsingRowHeightIndex from './mapDataUsingRowHeightIndex'; +import alignTableData from './alignTableData'; +import padTableData from './padTableData'; +import validateTableData from './validateTableData'; +import stringifyTableData from './stringifyTableData'; +import truncateTableData from './truncateTableData'; + +/** + * @typedef {string} table~cell + */ + +/** + * @typedef {table~cell[]} table~row + */ + +/** + * @typedef {Object} table~columns + * @property {string} alignment Cell content alignment (enum: left, center, right) (default: left). + * @property {number} width Column width (default: auto). + * @property {number} truncate Number of characters are which the content will be truncated (default: Infinity). + * @property {boolean} wrapWord When true the text is broken at the nearest space or one of the special characters + * @property {number} paddingLeft Cell content padding width left (default: 1). + * @property {number} paddingRight Cell content padding width right (default: 1). + */ + +/** + * @typedef {Object} table~border + * @property {string} topBody + * @property {string} topJoin + * @property {string} topLeft + * @property {string} topRight + * @property {string} bottomBody + * @property {string} bottomJoin + * @property {string} bottomLeft + * @property {string} bottomRight + * @property {string} bodyLeft + * @property {string} bodyRight + * @property {string} bodyJoin + * @property {string} joinBody + * @property {string} joinLeft + * @property {string} joinRight + * @property {string} joinJoin + */ + +/** + * Used to tell whether to draw a horizontal line. + * This callback is called for each non-content line of the table. + * The default behavior is to always return true. + * + * @typedef {Function} drawHorizontalLine + * @param {number} index + * @param {number} size + * @returns {boolean} + */ + +/** + * @typedef {Object} table~config + * @property {table~border} border + * @property {table~columns[]} columns Column specific configuration. + * @property {table~columns} columnDefault Default values for all columns. Column specific settings overwrite the default values. + * @property {table~drawHorizontalLine} drawHorizontalLine + */ + +/** + * Generates a text table. + * + * @param {table~row[]} data + * @param {table~config} userConfig + * @returns {string} + */ +export default (data, userConfig = {}) => { + let rows; + + validateTableData(data); + + rows = stringifyTableData(data); + + const config = makeConfig(rows, userConfig); + + rows = truncateTableData(data, config); + + const rowHeightIndex = calculateRowHeightIndex(rows, config); + + rows = mapDataUsingRowHeightIndex(rows, rowHeightIndex, config); + rows = alignTableData(rows, config); + rows = padTableData(rows, config); + + const cellWidthIndex = calculateCellWidthIndex(rows[0]); + + return drawTable(rows, config.border, cellWidthIndex, rowHeightIndex, config.drawHorizontalLine); +}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/table.js.map b/tools/node_modules/eslint/node_modules/table/dist/table.js.map new file mode 100644 index 00000000000000..5268d98da504b3 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/table.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/table.js"],"names":["data","userConfig","rows","config","rowHeightIndex","cellWidthIndex","border","drawHorizontalLine"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA;;;;AAIA;;;;AAIA;;;;;;;;;;AAUA;;;;;;;;;;;;;;;;;;;AAmBA;;;;;;;;;;;AAWA;;;;;;;;AAQA;;;;;;;eAOgBA,I,EAAMC,UAAU,GAAG,E,KAAO;AACxC,MAAIC,IAAJ;AAEA,kCAAkBF,IAAlB;AAEAE,EAAAA,IAAI,GAAG,iCAAmBF,IAAnB,CAAP;AAEA,QAAMG,MAAM,GAAG,yBAAWD,IAAX,EAAiBD,UAAjB,CAAf;AAEAC,EAAAA,IAAI,GAAG,gCAAkBF,IAAlB,EAAwBG,MAAxB,CAAP;AAEA,QAAMC,cAAc,GAAG,sCAAwBF,IAAxB,EAA8BC,MAA9B,CAAvB;AAEAD,EAAAA,IAAI,GAAG,yCAA2BA,IAA3B,EAAiCE,cAAjC,EAAiDD,MAAjD,CAAP;AACAD,EAAAA,IAAI,GAAG,6BAAeA,IAAf,EAAqBC,MAArB,CAAP;AACAD,EAAAA,IAAI,GAAG,2BAAaA,IAAb,EAAmBC,MAAnB,CAAP;AAEA,QAAME,cAAc,GAAG,sCAAwBH,IAAI,CAAC,CAAD,CAA5B,CAAvB;AAEA,SAAO,wBAAUA,IAAV,EAAgBC,MAAM,CAACG,MAAvB,EAA+BD,cAA/B,EAA+CD,cAA/C,EAA+DD,MAAM,CAACI,kBAAtE,CAAP;AACD,C","sourcesContent":["import drawTable from './drawTable';\nimport calculateCellWidthIndex from './calculateCellWidthIndex';\nimport makeConfig from './makeConfig';\nimport calculateRowHeightIndex from './calculateRowHeightIndex';\nimport mapDataUsingRowHeightIndex from './mapDataUsingRowHeightIndex';\nimport alignTableData from './alignTableData';\nimport padTableData from './padTableData';\nimport validateTableData from './validateTableData';\nimport stringifyTableData from './stringifyTableData';\nimport truncateTableData from './truncateTableData';\n\n/**\n * @typedef {string} table~cell\n */\n\n/**\n * @typedef {table~cell[]} table~row\n */\n\n/**\n * @typedef {Object} table~columns\n * @property {string} alignment Cell content alignment (enum: left, center, right) (default: left).\n * @property {number} width Column width (default: auto).\n * @property {number} truncate Number of characters are which the content will be truncated (default: Infinity).\n * @property {boolean} wrapWord When true the text is broken at the nearest space or one of the special characters\n * @property {number} paddingLeft Cell content padding width left (default: 1).\n * @property {number} paddingRight Cell content padding width right (default: 1).\n */\n\n/**\n * @typedef {Object} table~border\n * @property {string} topBody\n * @property {string} topJoin\n * @property {string} topLeft\n * @property {string} topRight\n * @property {string} bottomBody\n * @property {string} bottomJoin\n * @property {string} bottomLeft\n * @property {string} bottomRight\n * @property {string} bodyLeft\n * @property {string} bodyRight\n * @property {string} bodyJoin\n * @property {string} joinBody\n * @property {string} joinLeft\n * @property {string} joinRight\n * @property {string} joinJoin\n */\n\n/**\n * Used to tell whether to draw a horizontal line.\n * This callback is called for each non-content line of the table.\n * The default behavior is to always return true.\n *\n * @typedef {Function} drawHorizontalLine\n * @param {number} index\n * @param {number} size\n * @returns {boolean}\n */\n\n/**\n * @typedef {Object} table~config\n * @property {table~border} border\n * @property {table~columns[]} columns Column specific configuration.\n * @property {table~columns} columnDefault Default values for all columns. Column specific settings overwrite the default values.\n * @property {table~drawHorizontalLine} drawHorizontalLine\n */\n\n/**\n * Generates a text table.\n *\n * @param {table~row[]} data\n * @param {table~config} userConfig\n * @returns {string}\n */\nexport default (data, userConfig = {}) => {\n let rows;\n\n validateTableData(data);\n\n rows = stringifyTableData(data);\n\n const config = makeConfig(rows, userConfig);\n\n rows = truncateTableData(data, config);\n\n const rowHeightIndex = calculateRowHeightIndex(rows, config);\n\n rows = mapDataUsingRowHeightIndex(rows, rowHeightIndex, config);\n rows = alignTableData(rows, config);\n rows = padTableData(rows, config);\n\n const cellWidthIndex = calculateCellWidthIndex(rows[0]);\n\n return drawTable(rows, config.border, cellWidthIndex, rowHeightIndex, config.drawHorizontalLine);\n};\n"],"file":"table.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js b/tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js index 748b41cca7be17..210a124bcbffe2 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js +++ b/tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js @@ -1,12 +1,11 @@ -'use strict'; +"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = void 0; -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); +var _lodash = _interopRequireDefault(require("lodash")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -16,12 +15,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * @param {Object} config * @returns {table~row[]} */ -exports.default = (rows, config) => { +const truncateTableData = (rows, config) => { return rows.map(cells => { return cells.map((content, index) => { - return _lodash2.default.truncate(content, { + return _lodash.default.truncate(content, { length: config.columns[index].truncate }); }); }); -}; \ No newline at end of file +}; + +var _default = truncateTableData; +exports.default = _default; +//# sourceMappingURL=truncateTableData.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js.flow b/tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js.flow new file mode 100644 index 00000000000000..1052c92333033b --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js.flow @@ -0,0 +1,17 @@ +import _ from 'lodash'; + +/** + * @todo Make it work with ASCII content. + * @param {table~row[]} rows + * @param {Object} config + * @returns {table~row[]} + */ +export default (rows, config) => { + return rows.map((cells) => { + return cells.map((content, index) => { + return _.truncate(content, { + length: config.columns[index].truncate + }); + }); + }); +}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js.map b/tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js.map new file mode 100644 index 00000000000000..fbab35ea49bd14 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/truncateTableData.js"],"names":["rows","config","map","cells","content","index","_","truncate","length","columns"],"mappings":";;;;;;;AAAA;;;;AAEA;;;;;;2BAMgBA,I,EAAMC,M,KAAW;AAC/B,SAAOD,IAAI,CAACE,GAAL,CAAUC,KAAD,IAAW;AACzB,WAAOA,KAAK,CAACD,GAAN,CAAU,CAACE,OAAD,EAAUC,KAAV,KAAoB;AACnC,aAAOC,gBAAEC,QAAF,CAAWH,OAAX,EAAoB;AACzBI,QAAAA,MAAM,EAAEP,MAAM,CAACQ,OAAP,CAAeJ,KAAf,EAAsBE;AADL,OAApB,CAAP;AAGD,KAJM,CAAP;AAKD,GANM,CAAP;AAOD,C","sourcesContent":["import _ from 'lodash';\n\n/**\n * @todo Make it work with ASCII content.\n * @param {table~row[]} rows\n * @param {Object} config\n * @returns {table~row[]}\n */\nexport default (rows, config) => {\n return rows.map((cells) => {\n return cells.map((content, index) => {\n return _.truncate(content, {\n length: config.columns[index].truncate\n });\n });\n });\n};\n"],"file":"truncateTableData.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js b/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js index 3ea3ddea8ff36d..40d812777b5017 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js +++ b/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js @@ -14,7 +14,7 @@ var validate = (function() { var errs__0 = errors; var valid1 = true; for (var key0 in data) { - var isAdditional0 = !(false || validate.schema.properties[key0]); + var isAdditional0 = !(false || validate.schema.properties.hasOwnProperty(key0)); if (isAdditional0) { valid1 = false; var err = { @@ -344,7 +344,7 @@ var validate = (function() { var errs__0 = errors; var valid1 = true; for (var key0 in data) { - var isAdditional0 = !(false || validate.schema.properties[key0]); + var isAdditional0 = !(false || key0 == 'alignment' || key0 == 'width' || key0 == 'wrapWord' || key0 == 'truncate' || key0 == 'paddingLeft' || key0 == 'paddingRight'); if (isAdditional0) { valid1 = false; var err = { @@ -385,8 +385,7 @@ var validate = (function() { if (equal(data1, schema1[i1])) { valid1 = true; break; - } - if (!valid1) { + } if (!valid1) { var err = { keyword: 'enum', dataPath: (dataPath || '') + '.alignment', @@ -641,7 +640,7 @@ var validate = (function() { })(); validate.schema = { "$id": "config.json", - "$schema": "http://json-schema.org/draft-06/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "border": { diff --git a/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js.flow b/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js.flow new file mode 100644 index 00000000000000..14b9710135a17a --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js.flow @@ -0,0 +1,34 @@ +// eslint-disable-next-line import/default +import validateConfig from '../dist/validateConfig'; +// eslint-disable-next-line import/default +import validateStreamConfig from '../dist/validateStreamConfig'; + +const validate = { + 'config.json': validateConfig, + 'streamConfig.json': validateStreamConfig +}; + +/** + * @param {string} schemaId + * @param {formatData~config} config + * @returns {undefined} + */ +export default (schemaId, config = {}) => { + if (!validate[schemaId](config)) { + const errors = validate[schemaId].errors.map((error) => { + return { + dataPath: error.dataPath, + message: error.message, + params: error.params, + schemaPath: error.schemaPath + }; + }); + + /* eslint-disable no-console */ + console.log('config', config); + console.log('errors', errors); + /* eslint-enable no-console */ + + throw new Error('Invalid config.'); + } +}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js.map b/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js.map new file mode 100644 index 00000000000000..43bebf7a69b1d1 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/validateConfig.js"],"names":["validate","validateConfig","validateStreamConfig","schemaId","config","errors","map","error","dataPath","message","params","schemaPath","console","log","Error"],"mappings":";;;;;;;AACA;;AAEA;;;;AAHA;AAEA;AAGA,MAAMA,QAAQ,GAAG;AACf,iBAAeC,uBADA;AAEf,uBAAqBC;AAFN,CAAjB;AAKA;;;;;;yBAKgBC,Q,EAAUC,MAAM,GAAG,E,KAAO;AACxC,MAAI,CAACJ,QAAQ,CAACG,QAAD,CAAR,CAAmBC,MAAnB,CAAL,EAAiC;AAC/B,UAAMC,MAAM,GAAGL,QAAQ,CAACG,QAAD,CAAR,CAAmBE,MAAnB,CAA0BC,GAA1B,CAA+BC,KAAD,IAAW;AACtD,aAAO;AACLC,QAAAA,QAAQ,EAAED,KAAK,CAACC,QADX;AAELC,QAAAA,OAAO,EAAEF,KAAK,CAACE,OAFV;AAGLC,QAAAA,MAAM,EAAEH,KAAK,CAACG,MAHT;AAILC,QAAAA,UAAU,EAAEJ,KAAK,CAACI;AAJb,OAAP;AAMD,KAPc,CAAf;AASA;;AACAC,IAAAA,OAAO,CAACC,GAAR,CAAY,QAAZ,EAAsBT,MAAtB;AACAQ,IAAAA,OAAO,CAACC,GAAR,CAAY,QAAZ,EAAsBR,MAAtB;AACA;;AAEA,UAAM,IAAIS,KAAJ,CAAU,iBAAV,CAAN;AACD;AACF,C","sourcesContent":["// eslint-disable-next-line import/default\nimport validateConfig from '../dist/validateConfig';\n// eslint-disable-next-line import/default\nimport validateStreamConfig from '../dist/validateStreamConfig';\n\nconst validate = {\n 'config.json': validateConfig,\n 'streamConfig.json': validateStreamConfig\n};\n\n/**\n * @param {string} schemaId\n * @param {formatData~config} config\n * @returns {undefined}\n */\nexport default (schemaId, config = {}) => {\n if (!validate[schemaId](config)) {\n const errors = validate[schemaId].errors.map((error) => {\n return {\n dataPath: error.dataPath,\n message: error.message,\n params: error.params,\n schemaPath: error.schemaPath\n };\n });\n\n /* eslint-disable no-console */\n console.log('config', config);\n console.log('errors', errors);\n /* eslint-enable no-console */\n\n throw new Error('Invalid config.');\n }\n};\n"],"file":"validateConfig.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/validateStreamConfig.js b/tools/node_modules/eslint/node_modules/table/dist/validateStreamConfig.js index 05c4b04c6bf835..ff10e5909ff4cd 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/validateStreamConfig.js +++ b/tools/node_modules/eslint/node_modules/table/dist/validateStreamConfig.js @@ -14,7 +14,7 @@ var validate = (function() { var errs__0 = errors; var valid1 = true; for (var key0 in data) { - var isAdditional0 = !(false || validate.schema.properties[key0]); + var isAdditional0 = !(false || validate.schema.properties.hasOwnProperty(key0)); if (isAdditional0) { valid1 = false; var err = { @@ -344,7 +344,7 @@ var validate = (function() { var errs__0 = errors; var valid1 = true; for (var key0 in data) { - var isAdditional0 = !(false || validate.schema.properties[key0]); + var isAdditional0 = !(false || key0 == 'alignment' || key0 == 'width' || key0 == 'wrapWord' || key0 == 'truncate' || key0 == 'paddingLeft' || key0 == 'paddingRight'); if (isAdditional0) { valid1 = false; var err = { @@ -385,8 +385,7 @@ var validate = (function() { if (equal(data1, schema1[i1])) { valid1 = true; break; - } - if (!valid1) { + } if (!valid1) { var err = { keyword: 'enum', dataPath: (dataPath || '') + '.alignment', @@ -628,7 +627,7 @@ var validate = (function() { })(); validate.schema = { "$id": "streamConfig.json", - "$schema": "http://json-schema.org/draft-06/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "border": { diff --git a/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js b/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js index b5e103ce409c4d..124335cbfe794c 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js +++ b/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js @@ -1,8 +1,9 @@ -'use strict'; +"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = void 0; /** * @typedef {string} cell @@ -16,7 +17,7 @@ Object.defineProperty(exports, "__esModule", { * @param {column[]} rows * @returns {undefined} */ -exports.default = rows => { +const validateTableData = rows => { if (!Array.isArray(rows)) { throw new TypeError('Table data must be an array.'); } @@ -30,22 +31,68 @@ exports.default = rows => { } const columnNumber = rows[0].length; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; - for (const cells of rows) { - if (!Array.isArray(cells)) { - throw new TypeError('Table row data must be an array.'); - } + try { + for (var _iterator = rows[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + const cells = _step.value; - if (cells.length !== columnNumber) { - throw new Error('Table must have a consistent number of cells.'); - } + if (!Array.isArray(cells)) { + throw new TypeError('Table row data must be an array.'); + } + + if (cells.length !== columnNumber) { + throw new Error('Table must have a consistent number of cells.'); + } // @todo Make an exception for newline characters. + // @see https://github.com/gajus/table/issues/9 + + + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; - // @todo Make an exception for newline characters. - // @see https://github.com/gajus/table/issues/9 - for (const cell of cells) { - if (/[\u0001-\u001A]/.test(cell)) { - throw new Error('Table data must not contain control characters.'); + try { + for (var _iterator2 = cells[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + const cell = _step2.value; + + // eslint-disable-next-line no-control-regex + if (/[\u0001-\u001A]/.test(cell)) { + throw new Error('Table data must not contain control characters.'); + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; } } } -}; \ No newline at end of file +}; + +var _default = validateTableData; +exports.default = _default; +//# sourceMappingURL=validateTableData.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js.flow b/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js.flow new file mode 100644 index 00000000000000..075eaf09249a45 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js.flow @@ -0,0 +1,46 @@ +/** + * @typedef {string} cell + */ + +/** + * @typedef {cell[]} validateData~column + */ + +/** + * @param {column[]} rows + * @returns {undefined} + */ +export default (rows) => { + if (!Array.isArray(rows)) { + throw new TypeError('Table data must be an array.'); + } + + if (rows.length === 0) { + throw new Error('Table must define at least one row.'); + } + + if (rows[0].length === 0) { + throw new Error('Table must define at least one column.'); + } + + const columnNumber = rows[0].length; + + for (const cells of rows) { + if (!Array.isArray(cells)) { + throw new TypeError('Table row data must be an array.'); + } + + if (cells.length !== columnNumber) { + throw new Error('Table must have a consistent number of cells.'); + } + + // @todo Make an exception for newline characters. + // @see https://github.com/gajus/table/issues/9 + for (const cell of cells) { + // eslint-disable-next-line no-control-regex + if (/[\u0001-\u001A]/.test(cell)) { + throw new Error('Table data must not contain control characters.'); + } + } + } +}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js.map b/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js.map new file mode 100644 index 00000000000000..bd892651ceb068 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/validateTableData.js"],"names":["rows","Array","isArray","TypeError","length","Error","columnNumber","cells","cell","test"],"mappings":";;;;;;;AAAA;;;;AAIA;;;;AAIA;;;;0BAIgBA,I,IAAS;AACvB,MAAI,CAACC,KAAK,CAACC,OAAN,CAAcF,IAAd,CAAL,EAA0B;AACxB,UAAM,IAAIG,SAAJ,CAAc,8BAAd,CAAN;AACD;;AAED,MAAIH,IAAI,CAACI,MAAL,KAAgB,CAApB,EAAuB;AACrB,UAAM,IAAIC,KAAJ,CAAU,qCAAV,CAAN;AACD;;AAED,MAAIL,IAAI,CAAC,CAAD,CAAJ,CAAQI,MAAR,KAAmB,CAAvB,EAA0B;AACxB,UAAM,IAAIC,KAAJ,CAAU,wCAAV,CAAN;AACD;;AAED,QAAMC,YAAY,GAAGN,IAAI,CAAC,CAAD,CAAJ,CAAQI,MAA7B;AAbuB;AAAA;AAAA;;AAAA;AAevB,yBAAoBJ,IAApB,8HAA0B;AAAA,YAAfO,KAAe;;AACxB,UAAI,CAACN,KAAK,CAACC,OAAN,CAAcK,KAAd,CAAL,EAA2B;AACzB,cAAM,IAAIJ,SAAJ,CAAc,kCAAd,CAAN;AACD;;AAED,UAAII,KAAK,CAACH,MAAN,KAAiBE,YAArB,EAAmC;AACjC,cAAM,IAAID,KAAJ,CAAU,+CAAV,CAAN;AACD,OAPuB,CASxB;AACA;;;AAVwB;AAAA;AAAA;;AAAA;AAWxB,8BAAmBE,KAAnB,mIAA0B;AAAA,gBAAfC,IAAe;;AACxB;AACA,cAAI,kBAAkBC,IAAlB,CAAuBD,IAAvB,CAAJ,EAAkC;AAChC,kBAAM,IAAIH,KAAJ,CAAU,iDAAV,CAAN;AACD;AACF;AAhBuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBzB;AAhCsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiCxB,C","sourcesContent":["/**\n * @typedef {string} cell\n */\n\n/**\n * @typedef {cell[]} validateData~column\n */\n\n/**\n * @param {column[]} rows\n * @returns {undefined}\n */\nexport default (rows) => {\n if (!Array.isArray(rows)) {\n throw new TypeError('Table data must be an array.');\n }\n\n if (rows.length === 0) {\n throw new Error('Table must define at least one row.');\n }\n\n if (rows[0].length === 0) {\n throw new Error('Table must define at least one column.');\n }\n\n const columnNumber = rows[0].length;\n\n for (const cells of rows) {\n if (!Array.isArray(cells)) {\n throw new TypeError('Table row data must be an array.');\n }\n\n if (cells.length !== columnNumber) {\n throw new Error('Table must have a consistent number of cells.');\n }\n\n // @todo Make an exception for newline characters.\n // @see https://github.com/gajus/table/issues/9\n for (const cell of cells) {\n // eslint-disable-next-line no-control-regex\n if (/[\\u0001-\\u001A]/.test(cell)) {\n throw new Error('Table data must not contain control characters.');\n }\n }\n }\n};\n"],"file":"validateTableData.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/wrapString.js b/tools/node_modules/eslint/node_modules/table/dist/wrapString.js index eae8ea051d95fc..c0dd8c8d6f7e12 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/wrapString.js +++ b/tools/node_modules/eslint/node_modules/table/dist/wrapString.js @@ -1,16 +1,13 @@ -'use strict'; +"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = void 0; -var _sliceAnsi = require('slice-ansi'); +var _sliceAnsi = _interopRequireDefault(require("slice-ansi")); -var _sliceAnsi2 = _interopRequireDefault(_sliceAnsi); - -var _stringWidth = require('string-width'); - -var _stringWidth2 = _interopRequireDefault(_stringWidth); +var _stringWidth = _interopRequireDefault(require("string-width")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -25,18 +22,19 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * @param {number} size * @returns {Array} */ -exports.default = (subject, size) => { +const wrapString = (subject, size) => { let subjectSlice; - subjectSlice = subject; - const chunks = []; do { - chunks.push((0, _sliceAnsi2.default)(subjectSlice, 0, size)); - - subjectSlice = (0, _sliceAnsi2.default)(subjectSlice, size).trim(); - } while ((0, _stringWidth2.default)(subjectSlice)); + chunks.push((0, _sliceAnsi.default)(subjectSlice, 0, size)); + subjectSlice = (0, _sliceAnsi.default)(subjectSlice, size).trim(); + } while ((0, _stringWidth.default)(subjectSlice)); return chunks; -}; \ No newline at end of file +}; + +var _default = wrapString; +exports.default = _default; +//# sourceMappingURL=wrapString.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/wrapString.js.flow b/tools/node_modules/eslint/node_modules/table/dist/wrapString.js.flow new file mode 100644 index 00000000000000..bbb40721e34f99 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/wrapString.js.flow @@ -0,0 +1,29 @@ +import slice from 'slice-ansi'; +import stringWidth from 'string-width'; + +/** + * Creates an array of strings split into groups the length of size. + * This function works with strings that contain ASCII characters. + * + * wrapText is different from would-be "chunk" implementation + * in that whitespace characters that occur on a chunk size limit are trimmed. + * + * @param {string} subject + * @param {number} size + * @returns {Array} + */ +export default (subject, size) => { + let subjectSlice; + + subjectSlice = subject; + + const chunks = []; + + do { + chunks.push(slice(subjectSlice, 0, size)); + + subjectSlice = slice(subjectSlice, size).trim(); + } while (stringWidth(subjectSlice)); + + return chunks; +}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/wrapString.js.map b/tools/node_modules/eslint/node_modules/table/dist/wrapString.js.map new file mode 100644 index 00000000000000..3d1d7b3c0825a7 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/wrapString.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/wrapString.js"],"names":["subject","size","subjectSlice","chunks","push","trim"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA;;;;;;;;;;;oBAWgBA,O,EAASC,I,KAAS;AAChC,MAAIC,YAAJ;AAEAA,EAAAA,YAAY,GAAGF,OAAf;AAEA,QAAMG,MAAM,GAAG,EAAf;;AAEA,KAAG;AACDA,IAAAA,MAAM,CAACC,IAAP,CAAY,wBAAMF,YAAN,EAAoB,CAApB,EAAuBD,IAAvB,CAAZ;AAEAC,IAAAA,YAAY,GAAG,wBAAMA,YAAN,EAAoBD,IAApB,EAA0BI,IAA1B,EAAf;AACD,GAJD,QAIS,0BAAYH,YAAZ,CAJT;;AAMA,SAAOC,MAAP;AACD,C","sourcesContent":["import slice from 'slice-ansi';\nimport stringWidth from 'string-width';\n\n/**\n * Creates an array of strings split into groups the length of size.\n * This function works with strings that contain ASCII characters.\n *\n * wrapText is different from would-be \"chunk\" implementation\n * in that whitespace characters that occur on a chunk size limit are trimmed.\n *\n * @param {string} subject\n * @param {number} size\n * @returns {Array}\n */\nexport default (subject, size) => {\n let subjectSlice;\n\n subjectSlice = subject;\n\n const chunks = [];\n\n do {\n chunks.push(slice(subjectSlice, 0, size));\n\n subjectSlice = slice(subjectSlice, size).trim();\n } while (stringWidth(subjectSlice));\n\n return chunks;\n};\n"],"file":"wrapString.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/wrapWord.js b/tools/node_modules/eslint/node_modules/table/dist/wrapWord.js index c0dd9df4b05d76..790b20bc00414a 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/wrapWord.js +++ b/tools/node_modules/eslint/node_modules/table/dist/wrapWord.js @@ -1,16 +1,13 @@ -'use strict'; +"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = void 0; -var _sliceAnsi = require('slice-ansi'); +var _sliceAnsi = _interopRequireDefault(require("slice-ansi")); -var _sliceAnsi2 = _interopRequireDefault(_sliceAnsi); - -var _stringWidth = require('string-width'); - -var _stringWidth2 = _interopRequireDefault(_stringWidth); +var _stringWidth = _interopRequireDefault(require("string-width")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -19,34 +16,32 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * @param {number} size * @returns {Array} */ -exports.default = (input, size) => { +const wrapWord = (input, size) => { let subject; - subject = input; + const chunks = []; // https://regex101.com/r/gY5kZ1/1 - const chunks = []; - - // https://regex101.com/r/gY5kZ1/1 const re = new RegExp('(^.{1,' + size + '}(\\s+|$))|(^.{1,' + (size - 1) + '}(\\\\|/|_|\\.|,|;|-))'); do { let chunk; - chunk = subject.match(re); if (chunk) { chunk = chunk[0]; - - subject = (0, _sliceAnsi2.default)(subject, (0, _stringWidth2.default)(chunk)); - + subject = (0, _sliceAnsi.default)(subject, (0, _stringWidth.default)(chunk)); chunk = chunk.trim(); } else { - chunk = (0, _sliceAnsi2.default)(subject, 0, size); - subject = (0, _sliceAnsi2.default)(subject, size); + chunk = (0, _sliceAnsi.default)(subject, 0, size); + subject = (0, _sliceAnsi.default)(subject, size); } chunks.push(chunk); - } while ((0, _stringWidth2.default)(subject)); + } while ((0, _stringWidth.default)(subject)); return chunks; -}; \ No newline at end of file +}; + +var _default = wrapWord; +exports.default = _default; +//# sourceMappingURL=wrapWord.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/wrapWord.js.flow b/tools/node_modules/eslint/node_modules/table/dist/wrapWord.js.flow new file mode 100644 index 00000000000000..02a8d45ea4c9bd --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/wrapWord.js.flow @@ -0,0 +1,39 @@ +import slice from 'slice-ansi'; +import stringWidth from 'string-width'; + +/** + * @param {string} input + * @param {number} size + * @returns {Array} + */ +export default (input, size) => { + let subject; + + subject = input; + + const chunks = []; + + // https://regex101.com/r/gY5kZ1/1 + const re = new RegExp('(^.{1,' + size + '}(\\s+|$))|(^.{1,' + (size - 1) + '}(\\\\|/|_|\\.|,|;|-))'); + + do { + let chunk; + + chunk = subject.match(re); + + if (chunk) { + chunk = chunk[0]; + + subject = slice(subject, stringWidth(chunk)); + + chunk = chunk.trim(); + } else { + chunk = slice(subject, 0, size); + subject = slice(subject, size); + } + + chunks.push(chunk); + } while (stringWidth(subject)); + + return chunks; +}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/wrapWord.js.map b/tools/node_modules/eslint/node_modules/table/dist/wrapWord.js.map new file mode 100644 index 00000000000000..5e7aa9ccb73948 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/wrapWord.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/wrapWord.js"],"names":["input","size","subject","chunks","re","RegExp","chunk","match","trim","push"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA;;;;;kBAKgBA,K,EAAOC,I,KAAS;AAC9B,MAAIC,OAAJ;AAEAA,EAAAA,OAAO,GAAGF,KAAV;AAEA,QAAMG,MAAM,GAAG,EAAf,CAL8B,CAO9B;;AACA,QAAMC,EAAE,GAAG,IAAIC,MAAJ,CAAW,WAAWJ,IAAX,GAAkB,mBAAlB,IAAyCA,IAAI,GAAG,CAAhD,IAAqD,wBAAhE,CAAX;;AAEA,KAAG;AACD,QAAIK,KAAJ;AAEAA,IAAAA,KAAK,GAAGJ,OAAO,CAACK,KAAR,CAAcH,EAAd,CAAR;;AAEA,QAAIE,KAAJ,EAAW;AACTA,MAAAA,KAAK,GAAGA,KAAK,CAAC,CAAD,CAAb;AAEAJ,MAAAA,OAAO,GAAG,wBAAMA,OAAN,EAAe,0BAAYI,KAAZ,CAAf,CAAV;AAEAA,MAAAA,KAAK,GAAGA,KAAK,CAACE,IAAN,EAAR;AACD,KAND,MAMO;AACLF,MAAAA,KAAK,GAAG,wBAAMJ,OAAN,EAAe,CAAf,EAAkBD,IAAlB,CAAR;AACAC,MAAAA,OAAO,GAAG,wBAAMA,OAAN,EAAeD,IAAf,CAAV;AACD;;AAEDE,IAAAA,MAAM,CAACM,IAAP,CAAYH,KAAZ;AACD,GAjBD,QAiBS,0BAAYJ,OAAZ,CAjBT;;AAmBA,SAAOC,MAAP;AACD,C","sourcesContent":["import slice from 'slice-ansi';\nimport stringWidth from 'string-width';\n\n/**\n * @param {string} input\n * @param {number} size\n * @returns {Array}\n */\nexport default (input, size) => {\n let subject;\n\n subject = input;\n\n const chunks = [];\n\n // https://regex101.com/r/gY5kZ1/1\n const re = new RegExp('(^.{1,' + size + '}(\\\\s+|$))|(^.{1,' + (size - 1) + '}(\\\\\\\\|/|_|\\\\.|,|;|-))');\n\n do {\n let chunk;\n\n chunk = subject.match(re);\n\n if (chunk) {\n chunk = chunk[0];\n\n subject = slice(subject, stringWidth(chunk));\n\n chunk = chunk.trim();\n } else {\n chunk = slice(subject, 0, size);\n subject = slice(subject, size);\n }\n\n chunks.push(chunk);\n } while (stringWidth(subject));\n\n return chunks;\n};\n"],"file":"wrapWord.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/package.json b/tools/node_modules/eslint/node_modules/table/package.json index a84ae5396b0236..3e6fcb12d1985a 100644 --- a/tools/node_modules/eslint/node_modules/table/package.json +++ b/tools/node_modules/eslint/node_modules/table/package.json @@ -9,36 +9,48 @@ }, "bundleDependencies": false, "dependencies": { - "ajv": "^6.0.1", - "ajv-keywords": "^3.0.0", - "chalk": "^2.1.0", - "lodash": "^4.17.4", + "ajv": "^6.5.3", + "lodash": "^4.17.10", "slice-ansi": "1.0.0", "string-width": "^2.1.1" }, "deprecated": false, "description": "Formats data into a string table.", "devDependencies": { + "@babel/cli": "^7.1.2", + "@babel/core": "^7.1.2", + "@babel/node": "^7.0.0", + "@babel/plugin-transform-flow-strip-types": "^7.0.0", + "@babel/preset-env": "^7.1.0", + "@babel/register": "^7.0.0", "ajv-cli": "^3.0.0", - "babel": "^6.23.0", - "babel-cli": "^6.26.0", - "babel-core": "^6.26.0", - "babel-plugin-istanbul": "^4.1.5", - "babel-preset-es2015-node4": "^2.1.1", - "babel-register": "^6.26.0", - "chai": "^4.1.2", - "eslint": "^4.7.2", - "eslint-config-canonical": "^9.3.1", - "gitdown": "^2.5.1", - "husky": "^0.14.3", - "mocha": "^5.0.0", - "nyc": "^11.2.1", - "sinon": "^4.0.0" + "ajv-keywords": "^3.2.0", + "babel-plugin-istanbul": "^5.1.0", + "babel-plugin-transform-export-default-name": "^2.0.4", + "chai": "^4.2.0", + "chalk": "^2.4.1", + "coveralls": "^3.0.2", + "eslint": "^5.6.1", + "eslint-config-canonical": "^13.0.0", + "flow-bin": "^0.81.0", + "flow-copy-source": "^2.0.2", + "gitdown": "^2.5.4", + "husky": "^1.0.1", + "mocha": "^5.2.0", + "nyc": "^13.1.0", + "semantic-release": "^15.9.16", + "sinon": "^6.3.4" }, "engines": { - "node": ">=4.0.0" + "node": ">=6.0.0" }, "homepage": "https://github.com/gajus/table#readme", + "husky": { + "hooks": { + "post-commit": "npm run create-readme && git add README.md && git commit -m 'docs: generate docs' --no-verify", + "pre-commit": "npm run lint && npm run test && npm run build" + } + }, "keywords": [ "ascii", "text", @@ -51,12 +63,14 @@ "name": "table", "nyc": { "include": [ - "src/*.js" + "src/**/*.js" ], "instrument": false, - "lines": 70, + "reporter": [ + "text-lcov" + ], "require": [ - "babel-register" + "@babel/register" ], "sourceMap": false }, @@ -65,13 +79,11 @@ "url": "git+https://github.com/gajus/table.git" }, "scripts": { - "build": "rm -fr ./dist && NODE_ENV=production babel --copy-files ./src --out-dir ./dist && npm run make-validators", - "lint": "npm run build && eslint ./src ./tests", - "make-readme": "gitdown ./.README/README.md --output-file ./README.md", - "make-validators": "ajv compile --all-errors --inline-refs=false -s src/schemas/config -c ajv-keywords/keywords/typeof -o dist/validateConfig.js && ajv compile --all-errors --inline-refs=false -s src/schemas/streamConfig -c ajv-keywords/keywords/typeof -o dist/validateStreamConfig.js", - "precommit": "npm run lint && npm run test", - "prepublish": "NODE_ENV=production npm run build", - "test": "npm run build && nyc --check-coverage mocha" + "build": "rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && npm run create-validators && flow-copy-source src dist", + "create-readme": "gitdown ./.README/README.md --output-file ./README.md", + "create-validators": "ajv compile --all-errors --inline-refs=false -s src/schemas/config -c ajv-keywords/keywords/typeof -o dist/validateConfig.js && ajv compile --all-errors --inline-refs=false -s src/schemas/streamConfig -c ajv-keywords/keywords/typeof -o dist/validateStreamConfig.js", + "lint": "npm run build && eslint ./src ./test && flow", + "test": "mocha --require @babel/register" }, - "version": "4.0.3" + "version": "5.1.0" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/tslib/CopyrightNotice.txt b/tools/node_modules/eslint/node_modules/tslib/CopyrightNotice.txt index 4d8bc99e360ea5..0f6db1f75f714e 100644 --- a/tools/node_modules/eslint/node_modules/tslib/CopyrightNotice.txt +++ b/tools/node_modules/eslint/node_modules/tslib/CopyrightNotice.txt @@ -1,14 +1,15 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + diff --git a/tools/node_modules/eslint/node_modules/tslib/LICENSE.txt b/tools/node_modules/eslint/node_modules/tslib/LICENSE.txt index 2df8c87fda4e00..8746124b277914 100644 --- a/tools/node_modules/eslint/node_modules/tslib/LICENSE.txt +++ b/tools/node_modules/eslint/node_modules/tslib/LICENSE.txt @@ -1,55 +1,55 @@ -Apache License - -Version 2.0, January 2004 - -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - -"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: - -You must give any other recipients of the Work or Derivative Works a copy of this License; and - -You must cause any modified files to carry prominent notices stating that You changed the files; and - -You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and - -If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/tools/node_modules/eslint/node_modules/tslib/README.md b/tools/node_modules/eslint/node_modules/tslib/README.md index c9819aa2cccd26..ae595fe2342253 100644 --- a/tools/node_modules/eslint/node_modules/tslib/README.md +++ b/tools/node_modules/eslint/node_modules/tslib/README.md @@ -1,134 +1,134 @@ -# tslib - -This is a runtime library for [TypeScript](http://www.typescriptlang.org/) that contains all of the TypeScript helper functions. - -This library is primarily used by the `--importHelpers` flag in TypeScript. -When using `--importHelpers`, a module that uses helper functions like `__extends` and `__assign` in the following emitted file: - -```ts -var __assign = (this && this.__assign) || Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; -}; -exports.x = {}; -exports.y = __assign({}, exports.x); - -``` - -will instead be emitted as something like the following: - -```ts -var tslib_1 = require("tslib"); -exports.x = {}; -exports.y = tslib_1.__assign({}, exports.x); -``` - -Because this can avoid duplicate declarations of things like `__extends`, `__assign`, etc., this means delivering users smaller files on average, as well as less runtime overhead. -For optimized bundles with TypeScript, you should absolutely consider using `tslib` and `--importHelpers`. - -# Installing - -For the latest stable version, run: - -## npm - -```sh -# TypeScript 2.3.3 or later -npm install --save tslib - -# TypeScript 2.3.2 or earlier -npm install --save tslib@1.6.1 -``` - -## bower - -```sh -# TypeScript 2.3.3 or later -bower install tslib - -# TypeScript 2.3.2 or earlier -bower install tslib@1.6.1 -``` - -## JSPM - -```sh -# TypeScript 2.3.3 or later -jspm install tslib - -# TypeScript 2.3.2 or earlier -jspm install tslib@1.6.1 -``` - -# Usage - -Set the `importHelpers` compiler option on the command line: - -``` -tsc --importHelpers file.ts -``` - -or in your tsconfig.json: - -```json -{ - "compilerOptions": { - "importHelpers": true - } -} -``` - -#### For bower and JSPM users - -You will need to add a `paths` mapping for `tslib`, e.g. For Bower users: - -```json -{ - "compilerOptions": { - "module": "amd", - "importHelpers": true, - "baseUrl": "./", - "paths": { - "tslib" : ["bower_components/tslib/tslib.d.ts"] - } - } -} -``` - -For JSPM users: - -```json -{ - "compilerOptions": { - "module": "system", - "importHelpers": true, - "baseUrl": "./", - "paths": { - "tslib" : ["jspm_packages/npm/tslib@1.9.3/tslib.d.ts"] - } - } -} -``` - - -# Contribute - -There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript. - -* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in. -* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls). -* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript). -* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter. -* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). -* Read the language specification ([docx](http://go.microsoft.com/fwlink/?LinkId=267121), [pdf](http://go.microsoft.com/fwlink/?LinkId=267238)). - -# Documentation - -* [Quick tutorial](http://www.typescriptlang.org/Tutorial) -* [Programming handbook](http://www.typescriptlang.org/Handbook) -* [Language specification](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md) -* [Homepage](http://www.typescriptlang.org/) +# tslib + +This is a runtime library for [TypeScript](http://www.typescriptlang.org/) that contains all of the TypeScript helper functions. + +This library is primarily used by the `--importHelpers` flag in TypeScript. +When using `--importHelpers`, a module that uses helper functions like `__extends` and `__assign` in the following emitted file: + +```ts +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +exports.x = {}; +exports.y = __assign({}, exports.x); + +``` + +will instead be emitted as something like the following: + +```ts +var tslib_1 = require("tslib"); +exports.x = {}; +exports.y = tslib_1.__assign({}, exports.x); +``` + +Because this can avoid duplicate declarations of things like `__extends`, `__assign`, etc., this means delivering users smaller files on average, as well as less runtime overhead. +For optimized bundles with TypeScript, you should absolutely consider using `tslib` and `--importHelpers`. + +# Installing + +For the latest stable version, run: + +## npm + +```sh +# TypeScript 2.3.3 or later +npm install --save tslib + +# TypeScript 2.3.2 or earlier +npm install --save tslib@1.6.1 +``` + +## bower + +```sh +# TypeScript 2.3.3 or later +bower install tslib + +# TypeScript 2.3.2 or earlier +bower install tslib@1.6.1 +``` + +## JSPM + +```sh +# TypeScript 2.3.3 or later +jspm install tslib + +# TypeScript 2.3.2 or earlier +jspm install tslib@1.6.1 +``` + +# Usage + +Set the `importHelpers` compiler option on the command line: + +``` +tsc --importHelpers file.ts +``` + +or in your tsconfig.json: + +```json +{ + "compilerOptions": { + "importHelpers": true + } +} +``` + +#### For bower and JSPM users + +You will need to add a `paths` mapping for `tslib`, e.g. For Bower users: + +```json +{ + "compilerOptions": { + "module": "amd", + "importHelpers": true, + "baseUrl": "./", + "paths": { + "tslib" : ["bower_components/tslib/tslib.d.ts"] + } + } +} +``` + +For JSPM users: + +```json +{ + "compilerOptions": { + "module": "system", + "importHelpers": true, + "baseUrl": "./", + "paths": { + "tslib" : ["jspm_packages/npm/tslib@1.9.3/tslib.d.ts"] + } + } +} +``` + + +# Contribute + +There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript. + +* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in. +* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls). +* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript). +* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter. +* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). +* Read the language specification ([docx](http://go.microsoft.com/fwlink/?LinkId=267121), [pdf](http://go.microsoft.com/fwlink/?LinkId=267238)). + +# Documentation + +* [Quick tutorial](http://www.typescriptlang.org/Tutorial) +* [Programming handbook](http://www.typescriptlang.org/Handbook) +* [Language specification](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md) +* [Homepage](http://www.typescriptlang.org/) diff --git a/tools/node_modules/eslint/node_modules/tslib/tslib.d.ts b/tools/node_modules/eslint/node_modules/tslib/tslib.d.ts index 16be0f542deba9..c4a0e11584cd60 100644 --- a/tools/node_modules/eslint/node_modules/tslib/tslib.d.ts +++ b/tools/node_modules/eslint/node_modules/tslib/tslib.d.ts @@ -1,33 +1,33 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -export declare function __extends(d: Function, b: Function): void; -export declare function __assign(t: any, ...sources: any[]): any; -export declare function __rest(t: any, propertyNames: (string | symbol)[]): any; -export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; -export declare function __param(paramIndex: number, decorator: Function): Function; -export declare function __metadata(metadataKey: any, metadataValue: any): Function; -export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; -export declare function __generator(thisArg: any, body: Function): any; -export declare function __exportStar(m: any, exports: any): void; -export declare function __values(o: any): any; -export declare function __read(o: any, n?: number): any[]; -export declare function __spread(...args: any[]): any[]; -export declare function __await(v: any): any; -export declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any; -export declare function __asyncDelegator(o: any): any; -export declare function __asyncValues(o: any): any; -export declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray; -export declare function __importStar(mod: T): T; -export declare function __importDefault(mod: T): T | { default: T }; +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ +export declare function __extends(d: Function, b: Function): void; +export declare function __assign(t: any, ...sources: any[]): any; +export declare function __rest(t: any, propertyNames: (string | symbol)[]): any; +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +export declare function __param(paramIndex: number, decorator: Function): Function; +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; +export declare function __generator(thisArg: any, body: Function): any; +export declare function __exportStar(m: any, exports: any): void; +export declare function __values(o: any): any; +export declare function __read(o: any, n?: number): any[]; +export declare function __spread(...args: any[]): any[]; +export declare function __await(v: any): any; +export declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any; +export declare function __asyncDelegator(o: any): any; +export declare function __asyncValues(o: any): any; +export declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray; +export declare function __importStar(mod: T): T; +export declare function __importDefault(mod: T): T | { default: T }; diff --git a/tools/node_modules/eslint/node_modules/tslib/tslib.es6.js b/tools/node_modules/eslint/node_modules/tslib/tslib.es6.js index 45b35893ca4ca1..6da273e26024f1 100644 --- a/tools/node_modules/eslint/node_modules/tslib/tslib.es6.js +++ b/tools/node_modules/eslint/node_modules/tslib/tslib.es6.js @@ -1,186 +1,186 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -/* global Reflect, Promise */ - -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); -}; - -export function __extends(d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} - -export var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - } - return __assign.apply(this, arguments); -} - -export function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -} - -export function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} - -export function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} - -export function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -export function __awaiter(thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -export function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -export function __exportStar(m, exports) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} - -export function __values(o) { - var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; - if (m) return m.call(o); - return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; -} - -export function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -export function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -export function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -export function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -} - -export function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } -} - -export function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -} - -export function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - -export function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result.default = mod; - return result; -} - -export function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +export function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +export var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +export function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +} + +export function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +export function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +export function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +export function __awaiter(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +export function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +export function __exportStar(m, exports) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +export function __values(o) { + var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; + if (m) return m.call(o); + return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; +} + +export function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +export function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +export function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +export function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +export function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } +} + +export function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +export function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +export function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result.default = mod; + return result; +} + +export function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} diff --git a/tools/node_modules/eslint/node_modules/tslib/tslib.js b/tools/node_modules/eslint/node_modules/tslib/tslib.js index a74e93b05181c3..b0b1ff3ab8e776 100644 --- a/tools/node_modules/eslint/node_modules/tslib/tslib.js +++ b/tools/node_modules/eslint/node_modules/tslib/tslib.js @@ -1,243 +1,243 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if (typeof module === "object" && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - - __extends = function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __awaiter = function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function (m, exports) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; - }; - - __values = function (o) { - var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; - if (m) return m.call(o); - return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); -}); +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ +/* global global, define, System, Reflect, Promise */ +var __extends; +var __assign; +var __rest; +var __decorate; +var __param; +var __metadata; +var __awaiter; +var __generator; +var __exportStar; +var __values; +var __read; +var __spread; +var __await; +var __asyncGenerator; +var __asyncDelegator; +var __asyncValues; +var __makeTemplateObject; +var __importStar; +var __importDefault; +(function (factory) { + var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; + if (typeof define === "function" && define.amd) { + define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); + } + else if (typeof module === "object" && typeof module.exports === "object") { + factory(createExporter(root, createExporter(module.exports))); + } + else { + factory(createExporter(root)); + } + function createExporter(exports, previous) { + if (exports !== root) { + if (typeof Object.create === "function") { + Object.defineProperty(exports, "__esModule", { value: true }); + } + else { + exports.__esModule = true; + } + } + return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + } +}) +(function (exporter) { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + + __extends = function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + + __assign = Object.assign || function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + + __rest = function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; + }; + + __decorate = function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + + __param = function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } + }; + + __metadata = function (metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + }; + + __awaiter = function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + + __generator = function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + + __exportStar = function (m, exports) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; + }; + + __values = function (o) { + var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; + if (m) return m.call(o); + return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + }; + + __read = function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + }; + + __spread = function () { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; + }; + + __await = function (v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); + }; + + __asyncGenerator = function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + }; + + __asyncDelegator = function (o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } + }; + + __asyncValues = function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } + }; + + __makeTemplateObject = function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; + }; + + __importStar = function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; + }; + + __importDefault = function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; + }; + + exporter("__extends", __extends); + exporter("__assign", __assign); + exporter("__rest", __rest); + exporter("__decorate", __decorate); + exporter("__param", __param); + exporter("__metadata", __metadata); + exporter("__awaiter", __awaiter); + exporter("__generator", __generator); + exporter("__exportStar", __exportStar); + exporter("__values", __values); + exporter("__read", __read); + exporter("__spread", __spread); + exporter("__await", __await); + exporter("__asyncGenerator", __asyncGenerator); + exporter("__asyncDelegator", __asyncDelegator); + exporter("__asyncValues", __asyncValues); + exporter("__makeTemplateObject", __makeTemplateObject); + exporter("__importStar", __importStar); + exporter("__importDefault", __importDefault); +}); diff --git a/tools/node_modules/eslint/package.json b/tools/node_modules/eslint/package.json index 09880a0388c598..7b47dbd691f1ce 100644 --- a/tools/node_modules/eslint/package.json +++ b/tools/node_modules/eslint/package.json @@ -43,12 +43,12 @@ "path-is-inside": "^1.0.2", "pluralize": "^7.0.0", "progress": "^2.0.0", - "regexpp": "^2.0.0", + "regexpp": "^2.0.1", "require-uncached": "^1.0.3", "semver": "^5.5.1", "strip-ansi": "^4.0.0", "strip-json-comments": "^2.0.1", - "table": "^4.0.3", + "table": "^5.0.2", "text-table": "^0.2.0" }, "deprecated": false, @@ -69,7 +69,7 @@ "eslint-plugin-eslint-plugin": "^1.2.0", "eslint-plugin-node": "^7.0.1", "eslint-plugin-rulesdir": "^0.1.0", - "eslint-release": "^0.11.1", + "eslint-release": "^1.0.0", "eslint-rule-composer": "^0.3.0", "eslump": "^1.6.2", "esprima": "^4.0.1", @@ -120,20 +120,20 @@ "url": "git+https://github.com/eslint/eslint.git" }, "scripts": { - "alpharelease": "node Makefile.js prerelease -- alpha", - "betarelease": "node Makefile.js prerelease -- beta", "browserify": "node Makefile.js browserify", - "ci-release": "node Makefile.js ciRelease", "coveralls": "cat ./coverage/lcov.info | coveralls", "docs": "node Makefile.js docs", "fuzz": "node Makefile.js fuzz", + "generate-alpharelease": "node Makefile.js generatePrerelease -- alpha", + "generate-betarelease": "node Makefile.js generatePrerelease -- beta", + "generate-rcrelease": "node Makefile.js generatePrerelease -- rc", + "generate-release": "node Makefile.js generateRelease", "gensite": "node Makefile.js gensite", "lint": "node Makefile.js lint", "perf": "node Makefile.js perf", "profile": "beefy tests/bench/bench.js --open -- -t brfs -t ./tests/bench/xform-rules.js -r espree", - "rcrelease": "node Makefile.js prerelease -- rc", - "release": "node Makefile.js release", + "publish-release": "node Makefile.js publishRelease", "test": "node Makefile.js test" }, - "version": "5.6.1" + "version": "5.8.0" } \ No newline at end of file diff --git a/tools/pip/.gitignore b/tools/pip/.gitignore new file mode 100644 index 00000000000000..03eb26e01302fd --- /dev/null +++ b/tools/pip/.gitignore @@ -0,0 +1,2 @@ +*.pyc +site-packages \ No newline at end of file diff --git a/tools/pip/sitecustomize.py b/tools/pip/sitecustomize.py new file mode 100644 index 00000000000000..aa8087c8989604 --- /dev/null +++ b/tools/pip/sitecustomize.py @@ -0,0 +1,3 @@ +import os +import site +site.addsitedir(os.path.dirname(os.path.realpath(__file__)) + '/site-packages') diff --git a/tools/test.py b/tools/test.py index c5c9fb53c07626..cd361196653043 100755 --- a/tools/test.py +++ b/tools/test.py @@ -131,7 +131,7 @@ def RunSingle(self, parallel, thread_id): test = self.sequential_queue.get_nowait() except Empty: return - case = test.case + case = test case.thread_id = thread_id self.lock.acquire() self.AboutToRun(case) @@ -780,10 +780,10 @@ def CarCdr(path): class TestConfiguration(object): - - def __init__(self, context, root): + def __init__(self, context, root, section): self.context = context self.root = root + self.section = section def Contains(self, path, file): if len(path) > len(file): @@ -794,7 +794,9 @@ def Contains(self, path, file): return True def GetTestStatus(self, sections, defs): - pass + status_file = join(self.root, '%s.status' % self.section) + if exists(status_file): + ReadConfigurationInto(status_file, sections, defs) class TestSuite(object): @@ -848,15 +850,15 @@ def GetTestStatus(self, context, sections, defs): class LiteralTestSuite(TestSuite): - - def __init__(self, tests): + def __init__(self, tests_repos, test_root): super(LiteralTestSuite, self).__init__('root') - self.tests = tests + self.tests_repos = tests_repos + self.test_root = test_root def GetBuildRequirements(self, path, context): (name, rest) = CarCdr(path) result = [ ] - for test in self.tests: + for test in self.tests_repos: if not name or name.match(test.GetName()): result += test.GetBuildRequirements(rest, context) return result @@ -864,7 +866,7 @@ def GetBuildRequirements(self, path, context): def ListTests(self, current_path, path, context, arch, mode): (name, rest) = CarCdr(path) result = [ ] - for test in self.tests: + for test in self.tests_repos: test_name = test.GetName() if not name or name.match(test_name): full_path = current_path + [test_name] @@ -873,8 +875,11 @@ def ListTests(self, current_path, path, context, arch, mode): return result def GetTestStatus(self, context, sections, defs): - for test in self.tests: - test.GetTestStatus(context, sections, defs) + # Just read the test configuration from root_path/root.status. + root = TestConfiguration(context, self.test_root, 'root') + root.GetTestStatus(sections, defs) + for tests_repos in self.tests_repos: + tests_repos.GetTestStatus(context, sections, defs) TIMEOUT_SCALEFACTOR = { @@ -934,6 +939,7 @@ def RunTestCases(cases_to_run, progress, tasks, flaky_tests_mode): # ------------------------------------------- +RUN = 'run' SKIP = 'skip' FAIL = 'fail' PASS = 'pass' @@ -963,8 +969,8 @@ def __init__(self, name): self.name = name def GetOutcomes(self, env, defs): - if self.name in env: return ListSet([env[self.name]]) - else: return Nothing() + if self.name in env: return set([env[self.name]]) + else: return set() class Outcome(Expression): @@ -976,45 +982,7 @@ def GetOutcomes(self, env, defs): if self.name in defs: return defs[self.name].GetOutcomes(env, defs) else: - return ListSet([self.name]) - - -class Set(object): - pass - - -class ListSet(Set): - - def __init__(self, elms): - self.elms = elms - - def __str__(self): - return "ListSet%s" % str(self.elms) - - def Intersect(self, that): - if not isinstance(that, ListSet): - return that.Intersect(self) - return ListSet([ x for x in self.elms if x in that.elms ]) - - def Union(self, that): - if not isinstance(that, ListSet): - return that.Union(self) - return ListSet(self.elms + [ x for x in that.elms if x not in self.elms ]) - - def IsEmpty(self): - return len(self.elms) == 0 - - -class Nothing(Set): - - def Intersect(self, that): - return self - - def Union(self, that): - return that - - def IsEmpty(self): - return True + return set([self.name]) class Operation(Expression): @@ -1030,21 +998,23 @@ def Evaluate(self, env, defs): elif self.op == 'if': return False elif self.op == '==': - inter = self.left.GetOutcomes(env, defs).Intersect(self.right.GetOutcomes(env, defs)) - return not inter.IsEmpty() + inter = self.left.GetOutcomes(env, defs) & self.right.GetOutcomes(env, defs) + return bool(inter) else: assert self.op == '&&' return self.left.Evaluate(env, defs) and self.right.Evaluate(env, defs) def GetOutcomes(self, env, defs): if self.op == '||' or self.op == ',': - return self.left.GetOutcomes(env, defs).Union(self.right.GetOutcomes(env, defs)) + return self.left.GetOutcomes(env, defs) | self.right.GetOutcomes(env, defs) elif self.op == 'if': - if self.right.Evaluate(env, defs): return self.left.GetOutcomes(env, defs) - else: return Nothing() + if self.right.Evaluate(env, defs): + return self.left.GetOutcomes(env, defs) + else: + return set() else: assert self.op == '&&' - return self.left.GetOutcomes(env, defs).Intersect(self.right.GetOutcomes(env, defs)) + return self.left.GetOutcomes(env, defs) & self.right.GetOutcomes(env, defs) def IsAlpha(str): @@ -1223,15 +1193,6 @@ def ParseCondition(expr): return ast -class ClassifiedTest(object): - - def __init__(self, case, outcomes): - self.case = case - self.outcomes = outcomes - self.parallel = self.case.parallel - self.disable_core_files = self.case.disable_core_files - - class Configuration(object): """The parsed contents of a configuration file""" @@ -1240,23 +1201,18 @@ def __init__(self, sections, defs): self.defs = defs def ClassifyTests(self, cases, env): - sections = [s for s in self.sections if s.condition.Evaluate(env, self.defs)] + sections = [ s for s in self.sections if s.condition.Evaluate(env, self.defs) ] all_rules = reduce(list.__add__, [s.rules for s in sections], []) unused_rules = set(all_rules) - result = [ ] - all_outcomes = set([]) + result = [] for case in cases: matches = [ r for r in all_rules if r.Contains(case.path) ] - outcomes = set([]) - for rule in matches: - outcomes = outcomes.union(rule.GetOutcomes(env, self.defs)) - unused_rules.discard(rule) - if not outcomes: - outcomes = [PASS] - case.outcomes = outcomes - all_outcomes = all_outcomes.union(outcomes) - result.append(ClassifiedTest(case, outcomes)) - return (result, list(unused_rules), all_outcomes) + outcomes_list = [ r.GetOutcomes(env, self.defs) for r in matches ] + outcomes = reduce(set.union, outcomes_list, set()) + unused_rules.difference_update(matches) + case.outcomes = set(outcomes) or set([PASS]) + result.append(case) + return result, unused_rules class Section(object): @@ -1281,9 +1237,7 @@ def __init__(self, raw_path, path, value): self.value = value def GetOutcomes(self, env, defs): - set = self.value.GetOutcomes(env, defs) - assert isinstance(set, ListSet) - return set.elms + return self.value.GetOutcomes(env, defs) def Contains(self, path): if len(self.path) > len(path): @@ -1427,7 +1381,8 @@ def ProcessOptions(options): options.arch = options.arch.split(',') options.mode = options.mode.split(',') options.run = options.run.split(',') - options.skip_tests = options.skip_tests.split(',') + # Split at commas and filter out all the empty strings. + options.skip_tests = filter(bool, options.skip_tests.split(',')) if options.run == [""]: options.run = None elif len(options.run) != 2: @@ -1450,7 +1405,7 @@ def ProcessOptions(options): # tends to exaggerate the number of available cpus/cores. cores = os.environ.get('JOBS') options.j = int(cores) if cores is not None else multiprocessing.cpu_count() - if options.flaky_tests not in ["run", "skip", "dontcare"]: + if options.flaky_tests not in [RUN, SKIP, DONTCARE]: print "Unknown flaky-tests mode %s" % options.flaky_tests return False return True @@ -1464,18 +1419,6 @@ def ProcessOptions(options): * %(fail)4d tests are expected to fail that we should fix\ """ -def PrintReport(cases): - def IsFailOk(o): - return (len(o) == 2) and (FAIL in o) and (OKAY in o) - unskipped = [c for c in cases if not SKIP in c.outcomes] - print REPORT_TEMPLATE % { - 'total': len(cases), - 'skipped': len(cases) - len(unskipped), - 'pass': len([t for t in unskipped if list(t.outcomes) == [PASS]]), - 'fail_ok': len([t for t in unskipped if IsFailOk(t.outcomes)]), - 'fail': len([t for t in unskipped if list(t.outcomes) == [FAIL]]) - } - class Pattern(object): @@ -1534,6 +1477,14 @@ def FormatTime(d): return time.strftime("%M:%S.", time.gmtime(d)) + ("%03i" % millis) +def FormatTimedelta(td): + if hasattr(td.total, 'total_seconds'): + d = td.total_seconds() + else: # python2.6 compat + d = td.seconds + (td.microseconds / 10.0**6) + return FormatTime(d) + + def PrintCrashed(code): if utils.IsWindows(): return "CRASHED" @@ -1547,7 +1498,6 @@ def PrintCrashed(code): IGNORED_SUITES = [ 'addons', 'addons-napi', - 'code-cache', 'doctool', 'internet', 'pummel', @@ -1599,7 +1549,7 @@ def Main(): repositories = [TestRepository(join(workspace, 'test', name)) for name in suites] repositories += [TestRepository(a) for a in options.suite] - root = LiteralTestSuite(repositories) + root = LiteralTestSuite(repositories, test_root) paths = ArgsToTestPaths(test_root, args, suites) # Check for --valgrind option. If enabled, we overwrite the special @@ -1670,8 +1620,7 @@ def Main(): } test_list = root.ListTests([], path, context, arch, mode) unclassified_tests += test_list - (cases, unused_rules, _) = ( - config.ClassifyTests(test_list, env)) + cases, unused_rules = config.ClassifyTests(test_list, env) if globally_unused_rules is None: globally_unused_rules = set(unused_rules) else: @@ -1713,25 +1662,32 @@ def Main(): print "Could not create the temporary directory", options.temp_dir sys.exit(1) - if options.report: - PrintReport(all_cases) - - result = None - def DoSkip(case): - # A list of tests that should be skipped can be provided. This is - # useful for tests that fail in some environments, e.g., under coverage. - if options.skip_tests != [""]: - if [ st for st in options.skip_tests if st in case.case.file ]: - return True - if SKIP in case.outcomes or SLOW in case.outcomes: + def should_keep(case): + if any((s in case.file) for s in options.skip_tests): + return False + elif SKIP in case.outcomes: + return False + elif (options.flaky_tests == SKIP) and (set([SLOW, FLAKY]) & case.outcomes): + return False + else: return True - return FLAKY in case.outcomes and options.flaky_tests == SKIP - cases_to_run = [ c for c in all_cases if not DoSkip(c) ] + + cases_to_run = filter(should_keep, all_cases) + + if options.report: + print(REPORT_TEMPLATE % { + 'total': len(all_cases), + 'skipped': len(all_cases) - len(cases_to_run), + 'pass': len([t for t in cases_to_run if PASS in t.outcomes]), + 'fail_ok': len([t for t in cases_to_run if t.outcomes == set([FAIL, OKAY])]), + 'fail': len([t for t in cases_to_run if t.outcomes == set([FAIL])]) + }) + if options.run is not None: # Must ensure the list of tests is sorted before selecting, to avoid # silent errors if this file is changed to list the tests in a way that # can be different in different machines - cases_to_run.sort(key=lambda c: (c.case.arch, c.case.mode, c.case.file)) + cases_to_run.sort(key=lambda c: (c.arch, c.mode, c.file)) cases_to_run = [ cases_to_run[i] for i in xrange(options.run[0], len(cases_to_run), @@ -1756,13 +1712,11 @@ def DoSkip(case): # test output. print sys.stderr.write("--- Total time: %s ---\n" % FormatTime(duration)) - timed_tests = [ t.case for t in cases_to_run if not t.case.duration is None ] + timed_tests = [ t for t in cases_to_run if not t.duration is None ] timed_tests.sort(lambda a, b: a.CompareTime(b)) - index = 1 - for entry in timed_tests[:20]: - t = FormatTime(entry.duration.total_seconds()) - sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) - index += 1 + for i, entry in enumerate(timed_tests[:20], start=1): + t = FormatTimedelta(entry.duration) + sys.stderr.write("%4i (%s) %s\n" % (i, t, entry.GetLabel())) return result